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/message_loop/message_loop_proxy.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" |
11 #include "chrome/browser/extensions/test_blacklist.h" | 11 #include "chrome/browser/extensions/test_blacklist.h" |
12 #include "chrome/browser/extensions/webstore_installer_test.h" | 12 #include "chrome/browser/extensions/webstore_installer_test.h" |
13 #include "chrome/browser/ui/browser_finder.h" | 13 #include "chrome/browser/ui/browser_finder.h" |
14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
15 #include "chrome/common/chrome_switches.h" | 15 #include "chrome/common/chrome_switches.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 ExtensionInstallCheckerMock(Profile* profile, | 56 ExtensionInstallCheckerMock(Profile* profile, |
57 const std::string& requirements_error) | 57 const std::string& requirements_error) |
58 : extensions::ExtensionInstallChecker(profile), | 58 : extensions::ExtensionInstallChecker(profile), |
59 requirements_error_(requirements_error) {} | 59 requirements_error_(requirements_error) {} |
60 | 60 |
61 ~ExtensionInstallCheckerMock() override {} | 61 ~ExtensionInstallCheckerMock() override {} |
62 | 62 |
63 private: | 63 private: |
64 void CheckRequirements() override { | 64 void CheckRequirements() override { |
65 // Simulate an asynchronous operation. | 65 // Simulate an asynchronous operation. |
66 base::MessageLoopProxy::current()->PostTask( | 66 base::ThreadTaskRunnerHandle::Get()->PostTask( |
67 FROM_HERE, | 67 FROM_HERE, |
68 base::Bind(&ExtensionInstallCheckerMock::RequirementsErrorCheckDone, | 68 base::Bind(&ExtensionInstallCheckerMock::RequirementsErrorCheckDone, |
69 base::Unretained(this), | 69 base::Unretained(this), current_sequence_number())); |
70 current_sequence_number())); | |
71 } | 70 } |
72 | 71 |
73 void RequirementsErrorCheckDone(int sequence_number) { | 72 void RequirementsErrorCheckDone(int sequence_number) { |
74 std::vector<std::string> errors; | 73 std::vector<std::string> errors; |
75 errors.push_back(requirements_error_); | 74 errors.push_back(requirements_error_); |
76 OnRequirementsCheckDone(sequence_number, errors); | 75 OnRequirementsCheckDone(sequence_number, errors); |
77 } | 76 } |
78 | 77 |
79 std::string requirements_error_; | 78 std::string requirements_error_; |
80 }; | 79 }; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 } | 561 } |
563 | 562 |
564 // Verifies that a launch will fail if a duplicate launch is in progress. | 563 // Verifies that a launch will fail if a duplicate launch is in progress. |
565 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { | 564 IN_PROC_BROWSER_TEST_F(EphemeralAppLauncherTest, DuplicateLaunchInProgress) { |
566 extensions::ActiveInstallData install_data(kDefaultAppId); | 565 extensions::ActiveInstallData install_data(kDefaultAppId); |
567 install_data.is_ephemeral = true; | 566 install_data.is_ephemeral = true; |
568 InstallTracker::Get(profile())->AddActiveInstall(install_data); | 567 InstallTracker::Get(profile())->AddActiveInstall(install_data); |
569 | 568 |
570 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); | 569 RunLaunchTest(kDefaultAppId, webstore_install::LAUNCH_IN_PROGRESS, false); |
571 } | 570 } |
OLD | NEW |