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/string_util.h" | 5 #include "base/string_util.h" |
6 #include "base/stringprintf.h" | 6 #include "base/stringprintf.h" |
7 #include "base/values.h" | 7 #include "base/values.h" |
8 #include "chrome/browser/extensions/api/identity/identity_api.h" | 8 #include "chrome/browser/extensions/api/identity/identity_api.h" |
9 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" | 9 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
10 #include "chrome/browser/extensions/extension_apitest.h" | 10 #include "chrome/browser/extensions/extension_apitest.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 } | 63 } |
64 | 64 |
65 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 65 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
66 bool success, | 66 bool success, |
67 bool bad_message) OVERRIDE { | 67 bool bad_message) OVERRIDE { |
68 ASSERT_FALSE(bad_message); | 68 ASSERT_FALSE(bad_message); |
69 ASSERT_FALSE(HasResponse()); | 69 ASSERT_FALSE(HasResponse()); |
70 response_.reset(new bool); | 70 response_.reset(new bool); |
71 *response_ = success; | 71 *response_ = success; |
72 if (should_post_quit_) { | 72 if (should_post_quit_) { |
73 MessageLoopForUI::current()->Quit(); | 73 base::MessageLoopForUI::current()->Quit(); |
74 } | 74 } |
75 } | 75 } |
76 | 76 |
77 private: | 77 private: |
78 scoped_ptr<bool> response_; | 78 scoped_ptr<bool> response_; |
79 bool should_post_quit_; | 79 bool should_post_quit_; |
80 }; | 80 }; |
81 | 81 |
82 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { | 82 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { |
83 protected: | 83 protected: |
(...skipping 998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1082 "https://abcdefghij.chromiumapp.org/callback#test')</script>\"}]", | 1082 "https://abcdefghij.chromiumapp.org/callback#test')</script>\"}]", |
1083 browser())); | 1083 browser())); |
1084 | 1084 |
1085 std::string url; | 1085 std::string url; |
1086 EXPECT_TRUE(value->GetAsString(&url)); | 1086 EXPECT_TRUE(value->GetAsString(&url)); |
1087 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1087 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
1088 url); | 1088 url); |
1089 } | 1089 } |
1090 | 1090 |
1091 } // namespace extensions | 1091 } // namespace extensions |
OLD | NEW |