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

Side by Side Diff: chrome/browser/apps/ephemeral_app_launcher_browsertest.cc

Issue 1395103003: Don't use base::MessageLoop::{Quit,QuitClosure} in chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/thread_task_runner_handle.h" 5 #include "base/thread_task_runner_handle.h"
6 #include "chrome/browser/apps/ephemeral_app_launcher.h" 6 #include "chrome/browser/apps/ephemeral_app_launcher.h"
7 #include "chrome/browser/apps/ephemeral_app_service.h" 7 #include "chrome/browser/apps/ephemeral_app_service.h"
8 #include "chrome/browser/extensions/extension_install_checker.h" 8 #include "chrome/browser/extensions/extension_install_checker.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/extensions/install_tracker.h" 10 #include "chrome/browser/extensions/install_tracker.h"
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 webstore_install::Result result() const { return result_; } 143 webstore_install::Result result() const { return result_; }
144 const std::string& error() const { return error_; } 144 const std::string& error() const { return error_; }
145 145
146 void OnLaunchCallback(webstore_install::Result result, 146 void OnLaunchCallback(webstore_install::Result result,
147 const std::string& error) { 147 const std::string& error) {
148 result_ = result; 148 result_ = result;
149 error_ = error; 149 error_ = error;
150 done_ = true; 150 done_ = true;
151 if (waiting_) { 151 if (waiting_) {
152 waiting_ = false; 152 waiting_ = false;
153 base::MessageLoopForUI::current()->Quit(); 153 base::MessageLoopForUI::current()->QuitWhenIdle();
154 } 154 }
155 } 155 }
156 156
157 void Wait() { 157 void Wait() {
158 if (done_) 158 if (done_)
159 return; 159 return;
160 160
161 waiting_ = true; 161 waiting_ = true;
162 content::RunMessageLoop(); 162 content::RunMessageLoop();
163 } 163 }
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
554 } 554 }
555 555
556 // Verifies that a launch will fail if a duplicate launch is in progress. 556 // Verifies that a launch will fail if a duplicate launch is in progress.
557 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { 557 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) {
558 extensions::ActiveInstallData install_data(kDefaultAppId); 558 extensions::ActiveInstallData install_data(kDefaultAppId);
559 install_data.is_ephemeral = true; 559 install_data.is_ephemeral = true;
560 InstallTracker::Get(profile())->AddActiveInstall(install_data); 560 InstallTracker::Get(profile())->AddActiveInstall(install_data);
561 561
562 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); 562 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false);
563 } 563 }
OLDNEW
« no previous file with comments | « chrome/browser/apps/app_window_browsertest.cc ('k') | chrome/browser/autocomplete/autocomplete_provider_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698