summaryrefslogtreecommitdiffstats
path: root/unit
diff options
context:
space:
mode:
authorAndrzej Zaborowski <andrew.zaborowski@intel.com>2010-05-27 06:59:59 +0200
committerDenis Kenzior <denkenz@gmail.com>2010-05-28 11:41:53 -0500
commit103961c71b0bc74456fa149d5d6761cd3d97b6d4 (patch)
treed396aa61a811fa9f1728a5c386fb5adfc3bfa511 /unit
parent4f2a371a9f598b13bc68c3b6de992a83756942e0 (diff)
downloadofono-103961c71b0bc74456fa149d5d6761cd3d97b6d4.tar.bz2
test-stkutil: Add Launch Browser response builder tests
Diffstat (limited to 'unit')
-rw-r--r--unit/test-stkutil.c118
1 files changed, 118 insertions, 0 deletions
diff --git a/unit/test-stkutil.c b/unit/test-stkutil.c
index c2a1cb47..7505938e 100644
--- a/unit/test-stkutil.c
+++ b/unit/test-stkutil.c
@@ -17728,6 +17728,108 @@ static const struct terminal_response_test
},
};
+static const unsigned char launch_browser_response_111[] = {
+ 0x81, 0x03, 0x01, 0x15, 0x00, 0x82, 0x02, 0x82,
+ 0x81, 0x83, 0x01, 0x00,
+};
+
+static const struct terminal_response_test launch_browser_response_data_111 = {
+ .pdu = launch_browser_response_111,
+ .pdu_len = sizeof(launch_browser_response_111),
+ .response = {
+ .number = 1,
+ .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
+ .qualifier = 0x00, /* Launch browser, if not running */
+ .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ .result = {
+ .type = STK_RESULT_TYPE_SUCCESS,
+ },
+ },
+};
+
+static const unsigned char launch_browser_response_211[] = {
+ 0x81, 0x03, 0x01, 0x15, 0x02, 0x82, 0x02, 0x82,
+ 0x81, 0x83, 0x01, 0x00,
+};
+
+static const struct terminal_response_test launch_browser_response_data_211 = {
+ .pdu = launch_browser_response_211,
+ .pdu_len = sizeof(launch_browser_response_211),
+ .response = {
+ .number = 1,
+ .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
+ .qualifier = 0x02, /* Use the existing browser */
+ .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ .result = {
+ .type = STK_RESULT_TYPE_SUCCESS,
+ },
+ },
+};
+
+static const unsigned char launch_browser_response_221[] = {
+ 0x81, 0x03, 0x01, 0x15, 0x03, 0x82, 0x02, 0x82,
+ 0x81, 0x83, 0x01, 0x00,
+};
+
+static const struct terminal_response_test launch_browser_response_data_221 = {
+ .pdu = launch_browser_response_221,
+ .pdu_len = sizeof(launch_browser_response_221),
+ .response = {
+ .number = 1,
+ .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
+ .qualifier = 0x03, /* Re-start browser session */
+ .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ .result = {
+ .type = STK_RESULT_TYPE_SUCCESS,
+ },
+ },
+};
+
+static const unsigned char launch_browser_response_231[] = {
+ 0x81, 0x03, 0x01, 0x15, 0x00, 0x82, 0x02, 0x82,
+ 0x81, 0x83, 0x02, 0x26, 0x02,
+};
+
+static const struct terminal_response_test launch_browser_response_data_231 = {
+ .pdu = launch_browser_response_231,
+ .pdu_len = sizeof(launch_browser_response_231),
+ .response = {
+ .number = 1,
+ .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
+ .qualifier = 0x00, /* Launch browser, if not running */
+ .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ .result = {
+ .type = STK_RESULT_TYPE_BROWSER_TEMPORARY,
+ .additional_len = 1, /* Browser unavailable */
+ .additional = (unsigned char[1]) { 0x02 },
+ },
+ },
+};
+
+static const unsigned char launch_browser_response_411b[] = {
+ 0x81, 0x03, 0x01, 0x15, 0x02, 0x82, 0x02, 0x82,
+ 0x81, 0x83, 0x01, 0x04,
+};
+
+static const struct terminal_response_test launch_browser_response_data_411b = {
+ .pdu = launch_browser_response_411b,
+ .pdu_len = sizeof(launch_browser_response_411b),
+ .response = {
+ .number = 1,
+ .type = STK_COMMAND_TYPE_LAUNCH_BROWSER,
+ .qualifier = 0x02, /* Use the existing browser */
+ .src = STK_DEVICE_IDENTITY_TYPE_TERMINAL,
+ .dst = STK_DEVICE_IDENTITY_TYPE_UICC,
+ .result = {
+ .type = STK_RESULT_TYPE_NO_ICON,
+ },
+ },
+};
+
int main(int argc, char **argv)
{
g_test_init(&argc, &argv, NULL);
@@ -19373,5 +19475,21 @@ int main(int argc, char **argv)
g_test_add_data_func("/teststk/Launch Browser 7.1.1",
&launch_browser_data_711, test_launch_browser);
+ g_test_add_data_func("/teststk/Launch Browser response 1.1.1",
+ &launch_browser_response_data_111,
+ test_terminal_response_encoding);
+ g_test_add_data_func("/teststk/Launch Browser response 2.1.1",
+ &launch_browser_response_data_211,
+ test_terminal_response_encoding);
+ g_test_add_data_func("/teststk/Launch Browser response 2.2.1",
+ &launch_browser_response_data_221,
+ test_terminal_response_encoding);
+ g_test_add_data_func("/teststk/Launch Browser response 2.3.1",
+ &launch_browser_response_data_231,
+ test_terminal_response_encoding);
+ g_test_add_data_func("/teststk/Launch Browser response 4.1.1B",
+ &launch_browser_response_data_411b,
+ test_terminal_response_encoding);
+
return g_test_run();
}