Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: chrome/browser/extensions/api/identity/identity_apitest.cc

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698