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 <set> | 5 #include <set> |
6 #include <string> | 6 #include <string> |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 } | 98 } |
99 | 99 |
100 void OnSendResponse(UIThreadExtensionFunction* function, | 100 void OnSendResponse(UIThreadExtensionFunction* function, |
101 bool success, | 101 bool success, |
102 bool bad_message) override { | 102 bool bad_message) override { |
103 ASSERT_FALSE(bad_message); | 103 ASSERT_FALSE(bad_message); |
104 ASSERT_FALSE(HasResponse()); | 104 ASSERT_FALSE(HasResponse()); |
105 response_.reset(new bool); | 105 response_.reset(new bool); |
106 *response_ = success; | 106 *response_ = success; |
107 if (should_post_quit_) { | 107 if (should_post_quit_) { |
108 base::MessageLoopForUI::current()->Quit(); | 108 base::MessageLoopForUI::current()->QuitWhenIdle(); |
109 } | 109 } |
110 } | 110 } |
111 | 111 |
112 private: | 112 private: |
113 scoped_ptr<bool> response_; | 113 scoped_ptr<bool> response_; |
114 bool should_post_quit_; | 114 bool should_post_quit_; |
115 }; | 115 }; |
116 | 116 |
117 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { | 117 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { |
118 protected: | 118 protected: |
(...skipping 1810 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1929 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1929 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
1930 url); | 1930 url); |
1931 } | 1931 } |
1932 | 1932 |
1933 } // namespace extensions | 1933 } // namespace extensions |
1934 | 1934 |
1935 // Tests the chrome.identity API implemented by custom JS bindings . | 1935 // Tests the chrome.identity API implemented by custom JS bindings . |
1936 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { | 1936 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, ChromeIdentityJsBindings) { |
1937 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; | 1937 ASSERT_TRUE(RunExtensionTest("identity/js_bindings")) << message_; |
1938 } | 1938 } |
OLD | NEW |