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/extension_apitest.h" | 9 #include "chrome/browser/extensions/extension_apitest.h" |
10 #include "chrome/browser/extensions/extension_browsertest.h" | 10 #include "chrome/browser/extensions/extension_browsertest.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 } | 65 } |
66 | 66 |
67 virtual void OnSendResponse(UIThreadExtensionFunction* function, | 67 virtual void OnSendResponse(UIThreadExtensionFunction* function, |
68 bool success, | 68 bool success, |
69 bool bad_message) OVERRIDE { | 69 bool bad_message) OVERRIDE { |
70 ASSERT_FALSE(bad_message); | 70 ASSERT_FALSE(bad_message); |
71 ASSERT_FALSE(HasResponse()); | 71 ASSERT_FALSE(HasResponse()); |
72 response_.reset(new bool); | 72 response_.reset(new bool); |
73 *response_ = success; | 73 *response_ = success; |
74 if (should_post_quit_) { | 74 if (should_post_quit_) { |
75 MessageLoopForUI::current()->Quit(); | 75 base::MessageLoopForUI::current()->Quit(); |
76 } | 76 } |
77 } | 77 } |
78 | 78 |
79 private: | 79 private: |
80 scoped_ptr<bool> response_; | 80 scoped_ptr<bool> response_; |
81 bool should_post_quit_; | 81 bool should_post_quit_; |
82 }; | 82 }; |
83 | 83 |
84 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { | 84 class AsyncExtensionBrowserTest : public ExtensionBrowserTest { |
85 protected: | 85 protected: |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 scoped_ptr<base::Value> value(utils::RunFunctionAndReturnSingleResult( | 1061 scoped_ptr<base::Value> value(utils::RunFunctionAndReturnSingleResult( |
1062 function, args, browser())); | 1062 function, args, browser())); |
1063 | 1063 |
1064 std::string url; | 1064 std::string url; |
1065 EXPECT_TRUE(value->GetAsString(&url)); | 1065 EXPECT_TRUE(value->GetAsString(&url)); |
1066 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), | 1066 EXPECT_EQ(std::string("https://abcdefghij.chromiumapp.org/callback#test"), |
1067 url); | 1067 url); |
1068 } | 1068 } |
1069 | 1069 |
1070 } // namespace extensions | 1070 } // namespace extensions |
OLD | NEW |