| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |