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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/string_util.h" | 6 #include "base/strings/string_util.h" |
7 #include "base/strings/stringprintf.h" | 7 #include "base/strings/stringprintf.h" |
8 #include "base/values.h" | 8 #include "base/values.h" |
9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
10 #include "chrome/browser/extensions/api/identity/identity_api.h" | 10 #include "chrome/browser/extensions/api/identity/identity_api.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 EXPECT_TRUE(parsed_args.get()) << | 100 EXPECT_TRUE(parsed_args.get()) << |
101 "Could not parse extension function arguments: " << args; | 101 "Could not parse extension function arguments: " << args; |
102 function->SetArgs(parsed_args.get()); | 102 function->SetArgs(parsed_args.get()); |
103 | 103 |
104 if (!function->GetExtension()) { | 104 if (!function->GetExtension()) { |
105 scoped_refptr<Extension> empty_extension( | 105 scoped_refptr<Extension> empty_extension( |
106 utils::CreateEmptyExtension()); | 106 utils::CreateEmptyExtension()); |
107 function->set_extension(empty_extension.get()); | 107 function->set_extension(empty_extension.get()); |
108 } | 108 } |
109 | 109 |
110 function->set_context(browser()->profile()); | 110 function->set_browser_context(browser()->profile()); |
111 function->set_has_callback(true); | 111 function->set_has_callback(true); |
112 function->Run(); | 112 function->Run(); |
113 } | 113 } |
114 | 114 |
115 std::string WaitForError(UIThreadExtensionFunction* function) { | 115 std::string WaitForError(UIThreadExtensionFunction* function) { |
116 RunMessageLoopUntilResponse(); | 116 RunMessageLoopUntilResponse(); |
117 EXPECT_FALSE(function->GetResultList()) << "Did not expect a result"; | 117 EXPECT_FALSE(function->GetResultList()) << "Did not expect a result"; |
118 return function->GetError(); | 118 return function->GetError(); |
119 } | 119 } |
120 | 120 |
(...skipping 1151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1272 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
1273 url); | 1273 url); |
1274 } | 1274 } |
1275 | 1275 |
1276 } // namespace extensions | 1276 } // namespace extensions |
1277 | 1277 |
1278 // Tests the chrome.identity API implemented by custom JS bindings . | 1278 // Tests the chrome.identity API implemented by custom JS bindings . |
1279 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { | 1279 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { |
1280 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; | 1280 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; |
1281 } | 1281 } |
OLD | NEW |