| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 5 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 void SetUpCommandLine(base::CommandLine* command_line) override { | 245 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 246 InProcessBrowserTest::SetUpCommandLine(command_line); | 246 InProcessBrowserTest::SetUpCommandLine(command_line); |
| 247 | 247 |
| 248 // Initialize fake_cws_ to setup web store gallery. | 248 // Initialize fake_cws_ to setup web store gallery. |
| 249 fake_cws_->Init(embedded_test_server()); | 249 fake_cws_->Init(embedded_test_server()); |
| 250 } | 250 } |
| 251 | 251 |
| 252 void SetUpOnMainThread() override { | 252 void SetUpOnMainThread() override { |
| 253 InProcessBrowserTest::SetUpOnMainThread(); | 253 InProcessBrowserTest::SetUpOnMainThread(); |
| 254 | 254 |
| 255 host_resolver()->AddRule("*", "127.0.0.1"); |
| 256 |
| 255 // Start the accept thread as the sandbox host process has already been | 257 // Start the accept thread as the sandbox host process has already been |
| 256 // spawned. | 258 // spawned. |
| 257 embedded_test_server()->StartAcceptingConnections(); | 259 embedded_test_server()->StartAcceptingConnections(); |
| 258 | 260 |
| 259 settings_helper_.ReplaceProvider(kAccountsPrefDeviceLocalAccounts); | 261 settings_helper_.ReplaceProvider(kAccountsPrefDeviceLocalAccounts); |
| 260 owner_settings_service_ = | 262 owner_settings_service_ = |
| 261 settings_helper_.CreateOwnerSettingsService(browser()->profile()); | 263 settings_helper_.CreateOwnerSettingsService(browser()->profile()); |
| 262 } | 264 } |
| 263 | 265 |
| 264 void TearDownOnMainThread() override { settings_helper_.RestoreProvider(); } | 266 void TearDownOnMainThread() override { settings_helper_.RestoreProvider(); } |
| 265 | 267 |
| 266 void SetUpInProcessBrowserTestFixture() override { | |
| 267 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | |
| 268 | |
| 269 host_resolver()->AddRule("*", "127.0.0.1"); | |
| 270 } | |
| 271 | |
| 272 std::string GetAppIds() const { | 268 std::string GetAppIds() const { |
| 273 KioskAppManager::Apps apps; | 269 KioskAppManager::Apps apps; |
| 274 manager()->GetApps(&apps); | 270 manager()->GetApps(&apps); |
| 275 | 271 |
| 276 std::string str; | 272 std::string str; |
| 277 for (size_t i = 0; i < apps.size(); ++i) { | 273 for (size_t i = 0; i < apps.size(); ++i) { |
| 278 if (i > 0) | 274 if (i > 0) |
| 279 str += ','; | 275 str += ','; |
| 280 str += apps[i].app_id; | 276 str += apps[i].app_id; |
| 281 } | 277 } |
| (...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 MakeKioskApp("App Name", "1.0", kNoneAutoLaucnhedAppId, | 937 MakeKioskApp("App Name", "1.0", kNoneAutoLaucnhedAppId, |
| 942 kTestCases[i].required_platform_version); | 938 kTestCases[i].required_platform_version); |
| 943 EXPECT_TRUE(manager()->IsPlatformCompliantWithApp(app.get())) | 939 EXPECT_TRUE(manager()->IsPlatformCompliantWithApp(app.get())) |
| 944 << "Test case for non auto launch app: " << i | 940 << "Test case for non auto launch app: " << i |
| 945 << ", required_platform_version=" | 941 << ", required_platform_version=" |
| 946 << kTestCases[i].required_platform_version; | 942 << kTestCases[i].required_platform_version; |
| 947 } | 943 } |
| 948 } | 944 } |
| 949 | 945 |
| 950 } // namespace chromeos | 946 } // namespace chromeos |
| OLD | NEW |