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/experimental_identity_api.h" | 8 #include "chrome/browser/extensions/api/identity/experimental_identity_api.h" |
9 #include "chrome/browser/extensions/api/identity/identity_api.h" | 9 #include "chrome/browser/extensions/api/identity/identity_api.h" |
10 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" | 10 #include "chrome/browser/extensions/api/identity/web_auth_flow.h" |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 } | 61 } |
62 | 62 |
63 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 63 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
64 bool success, | 64 bool success, |
65 bool bad_message) OVERRIDE { | 65 bool bad_message) OVERRIDE { |
66 ASSERT_FALSE(bad_message); | 66 ASSERT_FALSE(bad_message); |
67 ASSERT_FALSE(HasResponse()); | 67 ASSERT_FALSE(HasResponse()); |
68 response_.reset(new bool); | 68 response_.reset(new bool); |
69 *response_ = success; | 69 *response_ = success; |
70 if (should_post_quit_) { | 70 if (should_post_quit_) { |
71 MessageLoopForUI::current()->Quit(); | 71 base::MessageLoopForUI::current()->Quit(); |
72 } | 72 } |
73 } | 73 } |
74 | 74 |
75 private: | 75 private: |
76 scoped_ptr<bool> response_; | 76 scoped_ptr<bool> response_; |
77 bool should_post_quit_; | 77 bool should_post_quit_; |
78 }; | 78 }; |
79 | 79 |
80 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { | 80 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { |
81 protected: | 81 protected: |
(...skipping 642 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
724 "https://abcdefghij.chromiumapp.org/callback#test')</script>\"}]", | 724 "https://abcdefghij.chromiumapp.org/callback#test')</script>\"}]", |
725 browser())); | 725 browser())); |
726 | 726 |
727 std::string url; | 727 std::string url; |
728 EXPECT_TRUE(value->GetAsString(&url)); | 728 EXPECT_TRUE(value->GetAsString(&url)); |
729 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 729 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
730 url); | 730 url); |
731 } | 731 } |
732 | 732 |
733 } // namespace extensions | 733 } // namespace extensions |
OLD | NEW |