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

Side by Side Diff: chrome/browser/extensions/api/webstore_private/webstore_private_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 <vector> 5 #include <vector>
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/files/file_path.h" 8 #include "base/files/file_path.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 public: 43 public:
44 WebstoreInstallListener() 44 WebstoreInstallListener()
45 : received_failure_(false), received_success_(false), waiting_(false) {} 45 : received_failure_(false), received_success_(false), waiting_(false) {}
46 46
47 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE { 47 virtual void OnExtensionInstallSuccess(const std::string& id) OVERRIDE {
48 received_success_ = true; 48 received_success_ = true;
49 id_ = id; 49 id_ = id;
50 50
51 if (waiting_) { 51 if (waiting_) {
52 waiting_ = false; 52 waiting_ = false;
53 MessageLoopForUI::current()->Quit(); 53 base::MessageLoopForUI::current()->Quit();
54 } 54 }
55 } 55 }
56 56
57 virtual void OnExtensionInstallFailure( 57 virtual void OnExtensionInstallFailure(
58 const std::string& id, 58 const std::string& id,
59 const std::string& error, 59 const std::string& error,
60 WebstoreInstaller::FailureReason reason) OVERRIDE { 60 WebstoreInstaller::FailureReason reason) OVERRIDE {
61 received_failure_ = true; 61 received_failure_ = true;
62 id_ = id; 62 id_ = id;
63 error_ = error; 63 error_ = error;
64 64
65 if (waiting_) { 65 if (waiting_) {
66 waiting_ = false; 66 waiting_ = false;
67 MessageLoopForUI::current()->Quit(); 67 base::MessageLoopForUI::current()->Quit();
68 } 68 }
69 } 69 }
70 70
71 void Wait() { 71 void Wait() {
72 if (received_success_ || received_failure_) 72 if (received_success_ || received_failure_)
73 return; 73 return;
74 74
75 waiting_ = true; 75 waiting_ = true;
76 content::RunMessageLoop(); 76 content::RunMessageLoop();
77 } 77 }
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
351 content::GpuDataManager::GetInstance()->InitializeForTesting( 351 content::GpuDataManager::GetInstance()->InitializeForTesting(
352 json_blacklist, gpu_info); 352 json_blacklist, gpu_info);
353 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted( 353 EXPECT_TRUE(content::GpuDataManager::GetInstance()->IsFeatureBlacklisted(
354 gpu::GPU_FEATURE_TYPE_WEBGL)); 354 gpu::GPU_FEATURE_TYPE_WEBGL));
355 355
356 bool webgl_allowed = false; 356 bool webgl_allowed = false;
357 RunTest(webgl_allowed); 357 RunTest(webgl_allowed);
358 } 358 }
359 359
360 } // namespace extensions 360 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698