OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 <memory> | 5 #include <memory> |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 command_line->AppendSwitchASCII(switches::kLoginUser, cryptohome_id.id()); | 101 command_line->AppendSwitchASCII(switches::kLoginUser, cryptohome_id.id()); |
102 command_line->AppendSwitchASCII( | 102 command_line->AppendSwitchASCII( |
103 switches::kLoginProfile, | 103 switches::kLoginProfile, |
104 CryptohomeClient::GetStubSanitizedUsername(cryptohome_id)); | 104 CryptohomeClient::GetStubSanitizedUsername(cryptohome_id)); |
105 | 105 |
106 fake_cws_->Init(embedded_test_server()); | 106 fake_cws_->Init(embedded_test_server()); |
107 fake_cws_->SetUpdateCrx(test_app_id_, test_app_id_ + ".crx", "1.0.0"); | 107 fake_cws_->SetUpdateCrx(test_app_id_, test_app_id_ + ".crx", "1.0.0"); |
108 } | 108 } |
109 | 109 |
110 void RunTestOnMainThreadLoop() override { | 110 void PreRunTestOnMainThread() override { |
111 termination_observer_.reset(new TerminationObserver()); | 111 termination_observer_.reset(new TerminationObserver()); |
112 | 112 InProcessBrowserTest::PreRunTestOnMainThread(); |
113 InProcessBrowserTest::RunTestOnMainThreadLoop(); | |
114 } | 113 } |
115 | 114 |
116 void SetUpOnMainThread() override { | 115 void SetUpOnMainThread() override { |
117 extensions::browsertest_util::CreateAndInitializeLocalCache(); | 116 extensions::browsertest_util::CreateAndInitializeLocalCache(); |
118 | 117 |
119 embedded_test_server()->StartAcceptingConnections(); | 118 embedded_test_server()->StartAcceptingConnections(); |
120 } | 119 } |
121 | 120 |
122 const std::string GetTestAppUserId() const { | 121 const std::string GetTestAppUserId() const { |
123 return policy::GenerateDeviceLocalAccountUserId( | 122 return policy::GenerateDeviceLocalAccountUserId( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 | 190 |
192 IN_PROC_BROWSER_TEST_F(KioskCrashRestoreTest, AppNotInstalled) { | 191 IN_PROC_BROWSER_TEST_F(KioskCrashRestoreTest, AppNotInstalled) { |
193 // If app is not installed when restoring from crash, the kiosk launch is | 192 // If app is not installed when restoring from crash, the kiosk launch is |
194 // expected to fail, as in that case the crash occured during the app | 193 // expected to fail, as in that case the crash occured during the app |
195 // initialization - before the app was actually launched. | 194 // initialization - before the app was actually launched. |
196 EXPECT_TRUE(termination_observer_->terminated()); | 195 EXPECT_TRUE(termination_observer_->terminated()); |
197 EXPECT_EQ(KioskAppLaunchError::UNABLE_TO_LAUNCH, KioskAppLaunchError::Get()); | 196 EXPECT_EQ(KioskAppLaunchError::UNABLE_TO_LAUNCH, KioskAppLaunchError::Get()); |
198 } | 197 } |
199 | 198 |
200 } // namespace chromeos | 199 } // namespace chromeos |
OLD | NEW |