OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ppapi/tests/test_talk_private.h" | 5 #include "ppapi/tests/test_talk_private.h" |
6 | 6 |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 #include <string.h> | 8 #include <string.h> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 std::string TestTalkPrivate::TestGetPermission() { | 48 std::string TestTalkPrivate::TestGetPermission() { |
49 if (!talk_private_interface_1) { | 49 if (!talk_private_interface_1) { |
50 PASS(); | 50 PASS(); |
51 } | 51 } |
52 | 52 |
53 if (!testing_interface_->IsOutOfProcess()) { | 53 if (!testing_interface_->IsOutOfProcess()) { |
54 // We only support out-of-process access to this API, so skip in-process | 54 // We only support out-of-process access to this API, so skip in-process |
55 PASS(); | 55 PASS(); |
56 } | 56 } |
57 | 57 |
58 #if defined(USE_ASH) | |
59 // Under Ash, this will prompt the user so the test cannot run in an automated | 58 // Under Ash, this will prompt the user so the test cannot run in an automated |
60 // fashion. To manually test under Ash, comment this out. | 59 // fashion. To manually test under Ash, replace "!defined(USE_ASH)" with 1. |
61 PASS(); | 60 #if !defined(USE_ASH) |
62 #endif | |
63 | |
64 PP_Resource talk_resource = talk_private_interface_1->Create( | 61 PP_Resource talk_resource = talk_private_interface_1->Create( |
65 instance_->pp_instance()); | 62 instance_->pp_instance()); |
66 | 63 |
67 TestCompletionCallback callback(instance_->pp_instance(), callback_type()); | 64 TestCompletionCallback callback(instance_->pp_instance(), callback_type()); |
68 callback.WaitForResult(talk_private_interface_1->GetPermission(talk_resource, | 65 callback.WaitForResult(talk_private_interface_1->GetPermission(talk_resource, |
69 callback.GetCallback().pp_completion_callback())); | 66 callback.GetCallback().pp_completion_callback())); |
70 CHECK_CALLBACK_BEHAVIOR(callback); | 67 CHECK_CALLBACK_BEHAVIOR(callback); |
71 | 68 |
72 #if defined(USE_ASH) | 69 #if defined(USE_ASH) |
73 // Under Ash, this test will actually prompt the user and return either true | 70 // Under Ash, this test will actually prompt the user and return either true |
74 // or false depending on their choice. | 71 // or false depending on their choice. |
75 if (callback.result() != 0 && callback.result() != 1) | 72 if (callback.result() != 0 && callback.result() != 1) |
76 return "Unexpected result"; | 73 return "Unexpected result"; |
77 #else | 74 #else |
78 // Currently not implemented without Ash, bur always returns false. | 75 // Currently not implemented without Ash, bur always returns false. |
79 if (callback.result() != 0) | 76 if (callback.result() != 0) |
80 return "Unexpected non-zero result"; | 77 return "Unexpected non-zero result"; |
81 #endif | 78 #endif |
82 | 79 #endif |
83 PASS(); | 80 PASS(); |
84 } | 81 } |
OLD | NEW |