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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
9 #include "base/files/scoped_temp_dir.h" | 9 #include "base/files/scoped_temp_dir.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/prefs/scoped_user_pref_update.h" | 12 #include "base/prefs/scoped_user_pref_update.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
16 #include "chrome/browser/chromeos/app_mode/fake_cws.h" | 16 #include "chrome/browser/chromeos/app_mode/fake_cws.h" |
17 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" | 17 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager_observer.h" |
18 #include "chrome/browser/chromeos/ownership/fake_owner_settings_service.h" | |
18 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" | 19 #include "chrome/browser/chromeos/policy/browser_policy_connector_chromeos.h" |
19 #include "chrome/browser/chromeos/policy/device_local_account.h" | 20 #include "chrome/browser/chromeos/policy/device_local_account.h" |
20 #include "chrome/browser/chromeos/settings/cros_settings.h" | 21 #include "chrome/browser/chromeos/settings/cros_settings.h" |
bartfab (slow)
2015/03/31 14:12:39
Nit: No longer used.
| |
21 #include "chrome/browser/ui/browser.h" | 22 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
23 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
24 #include "chrome/test/base/in_process_browser_test.h" | 25 #include "chrome/test/base/in_process_browser_test.h" |
25 #include "chromeos/settings/cros_settings_names.h" | 26 #include "chromeos/settings/cros_settings_names.h" |
26 #include "content/public/test/test_utils.h" | 27 #include "content/public/test/test_utils.h" |
27 #include "extensions/common/extension.h" | 28 #include "extensions/common/extension.h" |
28 #include "net/base/host_port_pair.h" | 29 #include "net/base/host_port_pair.h" |
29 #include "net/dns/mock_host_resolver.h" | 30 #include "net/dns/mock_host_resolver.h" |
30 #include "net/test/embedded_test_server/embedded_test_server.h" | 31 #include "net/test/embedded_test_server/embedded_test_server.h" |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
188 | 189 |
189 // Initialize fake_cws_ to setup web store gallery. | 190 // Initialize fake_cws_ to setup web store gallery. |
190 fake_cws_->Init(embedded_test_server()); | 191 fake_cws_->Init(embedded_test_server()); |
191 } | 192 } |
192 | 193 |
193 void SetUpOnMainThread() override { | 194 void SetUpOnMainThread() override { |
194 InProcessBrowserTest::SetUpOnMainThread(); | 195 InProcessBrowserTest::SetUpOnMainThread(); |
195 | 196 |
196 // Restart the thread as the sandbox host process has already been spawned. | 197 // Restart the thread as the sandbox host process has already been spawned. |
197 embedded_test_server()->RestartThreadAndListen(); | 198 embedded_test_server()->RestartThreadAndListen(); |
199 | |
200 owner_settings_service_.reset( | |
201 new chromeos::FakeOwnerSettingsService(browser()->profile())); | |
bartfab (slow)
2015/03/31 14:12:39
Nit: s/chromeos:://
| |
198 } | 202 } |
199 | 203 |
200 void SetUpInProcessBrowserTestFixture() override { | 204 void SetUpInProcessBrowserTestFixture() override { |
201 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); | 205 InProcessBrowserTest::SetUpInProcessBrowserTestFixture(); |
202 | 206 |
203 host_resolver()->AddRule("*", "127.0.0.1"); | 207 host_resolver()->AddRule("*", "127.0.0.1"); |
204 } | 208 } |
205 | 209 |
206 std::string GetAppIds() const { | 210 std::string GetAppIds() const { |
207 KioskAppManager::Apps apps; | 211 KioskAppManager::Apps apps; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 entry->SetStringWithoutPathExpansion( | 267 entry->SetStringWithoutPathExpansion( |
264 kAccountsPrefDeviceLocalAccountsKeyId, | 268 kAccountsPrefDeviceLocalAccountsKeyId, |
265 app_id + "_id"); | 269 app_id + "_id"); |
266 entry->SetIntegerWithoutPathExpansion( | 270 entry->SetIntegerWithoutPathExpansion( |
267 kAccountsPrefDeviceLocalAccountsKeyType, | 271 kAccountsPrefDeviceLocalAccountsKeyType, |
268 policy::DeviceLocalAccount::TYPE_KIOSK_APP); | 272 policy::DeviceLocalAccount::TYPE_KIOSK_APP); |
269 entry->SetStringWithoutPathExpansion( | 273 entry->SetStringWithoutPathExpansion( |
270 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, | 274 kAccountsPrefDeviceLocalAccountsKeyKioskAppId, |
271 app_id); | 275 app_id); |
272 device_local_accounts.Append(entry.release()); | 276 device_local_accounts.Append(entry.release()); |
273 CrosSettings::Get()->Set(kAccountsPrefDeviceLocalAccounts, | 277 owner_settings_service_->Set(kAccountsPrefDeviceLocalAccounts, |
274 device_local_accounts); | 278 device_local_accounts); |
275 } | 279 } |
276 | 280 |
277 bool GetCachedCrx(const std::string& app_id, | 281 bool GetCachedCrx(const std::string& app_id, |
278 base::FilePath* file_path, | 282 base::FilePath* file_path, |
279 std::string* version) { | 283 std::string* version) { |
280 return manager()->GetCachedCrx(app_id, file_path, version); | 284 return manager()->GetCachedCrx(app_id, file_path, version); |
281 } | 285 } |
282 | 286 |
283 void UpdateAppData() { manager()->UpdateAppData(); } | 287 void UpdateAppData() { manager()->UpdateAppData(); } |
284 | 288 |
285 void RunAddNewAppTest(const std::string& id, | 289 void RunAddNewAppTest(const std::string& id, |
286 const std::string& version, | 290 const std::string& version, |
287 const std::string& app_name) { | 291 const std::string& app_name) { |
288 std::string crx_file_name = id + ".crx"; | 292 std::string crx_file_name = id + ".crx"; |
289 fake_cws_->SetUpdateCrx(id, crx_file_name, version); | 293 fake_cws_->SetUpdateCrx(id, crx_file_name, version); |
290 | 294 |
291 AppDataLoadWaiter waiter(manager(), 3); | 295 AppDataLoadWaiter waiter(manager(), 3); |
292 manager()->AddApp(id); | 296 manager()->AddApp(id, owner_settings_service_.get()); |
293 waiter.Wait(); | 297 waiter.Wait(); |
294 EXPECT_TRUE(waiter.loaded()); | 298 EXPECT_TRUE(waiter.loaded()); |
295 | 299 |
296 // Check CRX file is cached. | 300 // Check CRX file is cached. |
297 base::FilePath crx_path; | 301 base::FilePath crx_path; |
298 std::string crx_version; | 302 std::string crx_version; |
299 EXPECT_TRUE(GetCachedCrx(id, &crx_path, &crx_version)); | 303 EXPECT_TRUE(GetCachedCrx(id, &crx_path, &crx_version)); |
300 EXPECT_TRUE(base::PathExists(crx_path)); | 304 EXPECT_TRUE(base::PathExists(crx_path)); |
301 EXPECT_EQ(version, crx_version); | 305 EXPECT_EQ(version, crx_version); |
302 // Verify the original crx file is identical to the cached file. | 306 // Verify the original crx file is identical to the cached file. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
335 expected_icon_path = | 339 expected_icon_path = |
336 expected_icon_path.AppendASCII(KioskAppManager::kIconCacheDir) | 340 expected_icon_path.AppendASCII(KioskAppManager::kIconCacheDir) |
337 .AppendASCII(apps[0].app_id) | 341 .AppendASCII(apps[0].app_id) |
338 .AddExtension(".png"); | 342 .AddExtension(".png"); |
339 EXPECT_EQ(expected_icon_path.value(), icon_path_string); | 343 EXPECT_EQ(expected_icon_path.value(), icon_path_string); |
340 } | 344 } |
341 | 345 |
342 KioskAppManager* manager() const { return KioskAppManager::Get(); } | 346 KioskAppManager* manager() const { return KioskAppManager::Get(); } |
343 FakeCWS* fake_cws() { return fake_cws_.get(); } | 347 FakeCWS* fake_cws() { return fake_cws_.get(); } |
344 | 348 |
349 protected: | |
350 scoped_ptr<chromeos::FakeOwnerSettingsService> owner_settings_service_; | |
bartfab (slow)
2015/03/31 14:12:39
Nit 1: #include "base/memory/scoped_ptr.h"
Nit 2:
| |
351 | |
345 private: | 352 private: |
346 base::ScopedTempDir temp_dir_; | 353 base::ScopedTempDir temp_dir_; |
347 scoped_ptr<FakeCWS> fake_cws_; | 354 scoped_ptr<FakeCWS> fake_cws_; |
348 | 355 |
349 DISALLOW_COPY_AND_ASSIGN(KioskAppManagerTest); | 356 DISALLOW_COPY_AND_ASSIGN(KioskAppManagerTest); |
350 }; | 357 }; |
351 | 358 |
352 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, Basic) { | 359 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, Basic) { |
353 // Add a couple of apps. Use "fake_app_x" that do not have data on the test | 360 // Add a couple of apps. Use "fake_app_x" that do not have data on the test |
354 // server to avoid pending data loads that could be lingering on tear down and | 361 // server to avoid pending data loads that could be lingering on tear down and |
355 // cause DCHECK failure in utility_process_host_impl.cc. | 362 // cause DCHECK failure in utility_process_host_impl.cc. |
356 manager()->AddApp("fake_app_1"); | 363 manager()->AddApp("fake_app_1", owner_settings_service_.get()); |
357 manager()->AddApp("fake_app_2"); | 364 manager()->AddApp("fake_app_2", owner_settings_service_.get()); |
358 EXPECT_EQ("fake_app_1,fake_app_2", GetAppIds()); | 365 EXPECT_EQ("fake_app_1,fake_app_2", GetAppIds()); |
359 | 366 |
360 // Set an auto launch app. | 367 // Set an auto launch app. |
361 manager()->SetAutoLaunchApp("fake_app_1"); | 368 manager()->SetAutoLaunchApp("fake_app_1", owner_settings_service_.get()); |
362 EXPECT_EQ("fake_app_1", manager()->GetAutoLaunchApp()); | 369 EXPECT_EQ("fake_app_1", manager()->GetAutoLaunchApp()); |
363 | 370 |
364 // Make sure that if an app was auto launched with zero delay, it is reflected | 371 // Make sure that if an app was auto launched with zero delay, it is reflected |
365 // in the app data. | 372 // in the app data. |
366 KioskAppManager::App app; | 373 KioskAppManager::App app; |
367 manager()->GetApp("fake_app_1", &app); | 374 manager()->GetApp("fake_app_1", &app); |
368 EXPECT_FALSE(app.was_auto_launched_with_zero_delay); | 375 EXPECT_FALSE(app.was_auto_launched_with_zero_delay); |
369 | 376 |
370 manager()->SetAppWasAutoLaunchedWithZeroDelay("fake_app_1"); | 377 manager()->SetAppWasAutoLaunchedWithZeroDelay("fake_app_1"); |
371 manager()->GetApp("fake_app_1", &app); | 378 manager()->GetApp("fake_app_1", &app); |
372 EXPECT_TRUE(app.was_auto_launched_with_zero_delay); | 379 EXPECT_TRUE(app.was_auto_launched_with_zero_delay); |
373 | 380 |
374 // Clear the auto launch app. | 381 // Clear the auto launch app. |
375 manager()->SetAutoLaunchApp(""); | 382 manager()->SetAutoLaunchApp("", owner_settings_service_.get()); |
376 EXPECT_EQ("", manager()->GetAutoLaunchApp()); | 383 EXPECT_EQ("", manager()->GetAutoLaunchApp()); |
377 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); | 384 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); |
378 | 385 |
379 // App should still report it was auto launched with zero delay, even though | 386 // App should still report it was auto launched with zero delay, even though |
380 // it is no longer set to auto launch in the future. | 387 // it is no longer set to auto launch in the future. |
381 manager()->GetApp("fake_app_1", &app); | 388 manager()->GetApp("fake_app_1", &app); |
382 EXPECT_TRUE(app.was_auto_launched_with_zero_delay); | 389 EXPECT_TRUE(app.was_auto_launched_with_zero_delay); |
383 | 390 |
384 // Set another auto launch app. | 391 // Set another auto launch app. |
385 manager()->SetAutoLaunchApp("fake_app_2"); | 392 manager()->SetAutoLaunchApp("fake_app_2", owner_settings_service_.get()); |
386 EXPECT_EQ("fake_app_2", manager()->GetAutoLaunchApp()); | 393 EXPECT_EQ("fake_app_2", manager()->GetAutoLaunchApp()); |
387 | 394 |
388 // Check auto launch permissions. | 395 // Check auto launch permissions. |
389 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); | 396 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); |
390 manager()->SetEnableAutoLaunch(true); | 397 manager()->SetEnableAutoLaunch(true); |
391 EXPECT_TRUE(manager()->IsAutoLaunchEnabled()); | 398 EXPECT_TRUE(manager()->IsAutoLaunchEnabled()); |
392 | 399 |
393 // Remove the auto launch app. | 400 // Remove the auto launch app. |
394 manager()->RemoveApp("fake_app_2"); | 401 manager()->RemoveApp("fake_app_2", owner_settings_service_.get()); |
395 EXPECT_EQ("fake_app_1", GetAppIds()); | 402 EXPECT_EQ("fake_app_1", GetAppIds()); |
396 EXPECT_EQ("", manager()->GetAutoLaunchApp()); | 403 EXPECT_EQ("", manager()->GetAutoLaunchApp()); |
397 | 404 |
398 // Add the just removed auto launch app again and it should no longer be | 405 // Add the just removed auto launch app again and it should no longer be |
399 // the auto launch app. | 406 // the auto launch app. |
400 manager()->AddApp("fake_app_2"); | 407 manager()->AddApp("fake_app_2", owner_settings_service_.get()); |
401 EXPECT_EQ("", manager()->GetAutoLaunchApp()); | 408 EXPECT_EQ("", manager()->GetAutoLaunchApp()); |
402 manager()->RemoveApp("fake_app_2"); | 409 manager()->RemoveApp("fake_app_2", owner_settings_service_.get()); |
403 EXPECT_EQ("fake_app_1", GetAppIds()); | 410 EXPECT_EQ("fake_app_1", GetAppIds()); |
404 | 411 |
405 // Set a none exist app as auto launch. | 412 // Set a none exist app as auto launch. |
406 manager()->SetAutoLaunchApp("none_exist_app"); | 413 manager()->SetAutoLaunchApp("none_exist_app", owner_settings_service_.get()); |
407 EXPECT_EQ("", manager()->GetAutoLaunchApp()); | 414 EXPECT_EQ("", manager()->GetAutoLaunchApp()); |
408 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); | 415 EXPECT_FALSE(manager()->IsAutoLaunchEnabled()); |
409 | 416 |
410 // Add an existing app again. | 417 // Add an existing app again. |
411 manager()->AddApp("fake_app_1"); | 418 manager()->AddApp("fake_app_1", owner_settings_service_.get()); |
412 EXPECT_EQ("fake_app_1", GetAppIds()); | 419 EXPECT_EQ("fake_app_1", GetAppIds()); |
413 } | 420 } |
414 | 421 |
415 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, LoadCached) { | 422 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, LoadCached) { |
416 SetExistingApp("app_1", "Cached App1 Name", "red16x16.png"); | 423 SetExistingApp("app_1", "Cached App1 Name", "red16x16.png"); |
417 | 424 |
418 fake_cws()->SetNoUpdate("app_1"); | 425 fake_cws()->SetNoUpdate("app_1"); |
419 AppDataLoadWaiter waiter(manager(), 1); | 426 AppDataLoadWaiter waiter(manager(), 1); |
420 waiter.Wait(); | 427 waiter.Wait(); |
421 EXPECT_TRUE(waiter.loaded()); | 428 EXPECT_TRUE(waiter.loaded()); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 EXPECT_TRUE(waiter.loaded()); | 473 EXPECT_TRUE(waiter.loaded()); |
467 | 474 |
468 manager()->GetApps(&apps); | 475 manager()->GetApps(&apps); |
469 EXPECT_EQ(1u, apps.size()); | 476 EXPECT_EQ(1u, apps.size()); |
470 EXPECT_EQ("app_1", apps[0].app_id); | 477 EXPECT_EQ("app_1", apps[0].app_id); |
471 EXPECT_EQ("Updated App1 Name", apps[0].name); | 478 EXPECT_EQ("Updated App1 Name", apps[0].name); |
472 } | 479 } |
473 | 480 |
474 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, BadApp) { | 481 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, BadApp) { |
475 AppDataLoadWaiter waiter(manager(), 2); | 482 AppDataLoadWaiter waiter(manager(), 2); |
476 manager()->AddApp("unknown_app"); | 483 manager()->AddApp("unknown_app", owner_settings_service_.get()); |
477 waiter.Wait(); | 484 waiter.Wait(); |
478 EXPECT_FALSE(waiter.loaded()); | 485 EXPECT_FALSE(waiter.loaded()); |
479 EXPECT_EQ("", GetAppIds()); | 486 EXPECT_EQ("", GetAppIds()); |
480 } | 487 } |
481 | 488 |
482 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, GoodApp) { | 489 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, GoodApp) { |
483 // Webstore data json is in | 490 // Webstore data json is in |
484 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/detail/app_1 | 491 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/detail/app_1 |
485 fake_cws()->SetNoUpdate("app_1"); | 492 fake_cws()->SetNoUpdate("app_1"); |
486 AppDataLoadWaiter waiter(manager(), 2); | 493 AppDataLoadWaiter waiter(manager(), 2); |
487 manager()->AddApp("app_1"); | 494 manager()->AddApp("app_1", owner_settings_service_.get()); |
488 waiter.Wait(); | 495 waiter.Wait(); |
489 EXPECT_TRUE(waiter.loaded()); | 496 EXPECT_TRUE(waiter.loaded()); |
490 | 497 |
491 // Check data is correct. | 498 // Check data is correct. |
492 KioskAppManager::Apps apps; | 499 KioskAppManager::Apps apps; |
493 manager()->GetApps(&apps); | 500 manager()->GetApps(&apps); |
494 ASSERT_EQ(1u, apps.size()); | 501 ASSERT_EQ(1u, apps.size()); |
495 EXPECT_EQ("app_1", apps[0].app_id); | 502 EXPECT_EQ("app_1", apps[0].app_id); |
496 EXPECT_EQ("Name of App 1", apps[0].name); | 503 EXPECT_EQ("Name of App 1", apps[0].name); |
497 EXPECT_EQ(gfx::Size(16, 16), apps[0].icon.size()); | 504 EXPECT_EQ(gfx::Size(16, 16), apps[0].icon.size()); |
(...skipping 28 matching lines...) Expand all Loading... | |
526 KioskAppManager::Apps apps; | 533 KioskAppManager::Apps apps; |
527 manager()->GetApps(&apps); | 534 manager()->GetApps(&apps); |
528 ASSERT_EQ(1u, apps.size()); | 535 ASSERT_EQ(1u, apps.size()); |
529 base::FilePath crx_path; | 536 base::FilePath crx_path; |
530 std::string version; | 537 std::string version; |
531 EXPECT_TRUE(GetCachedCrx(kTestLocalFsKioskApp, &crx_path, &version)); | 538 EXPECT_TRUE(GetCachedCrx(kTestLocalFsKioskApp, &crx_path, &version)); |
532 EXPECT_TRUE(base::PathExists(crx_path)); | 539 EXPECT_TRUE(base::PathExists(crx_path)); |
533 EXPECT_EQ("1.0.0", version); | 540 EXPECT_EQ("1.0.0", version); |
534 | 541 |
535 // Remove the app now. | 542 // Remove the app now. |
536 manager()->RemoveApp(kTestLocalFsKioskApp); | 543 manager()->RemoveApp(kTestLocalFsKioskApp, owner_settings_service_.get()); |
537 content::RunAllBlockingPoolTasksUntilIdle(); | 544 content::RunAllBlockingPoolTasksUntilIdle(); |
538 manager()->GetApps(&apps); | 545 manager()->GetApps(&apps); |
539 ASSERT_EQ(0u, apps.size()); | 546 ASSERT_EQ(0u, apps.size()); |
540 EXPECT_FALSE(base::PathExists(crx_path)); | 547 EXPECT_FALSE(base::PathExists(crx_path)); |
541 EXPECT_FALSE(GetCachedCrx(kTestLocalFsKioskApp, &crx_path, &version)); | 548 EXPECT_FALSE(GetCachedCrx(kTestLocalFsKioskApp, &crx_path, &version)); |
542 } | 549 } |
543 | 550 |
544 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, UpdateApp) { | 551 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, UpdateApp) { |
545 // Add a version 1 app first. | 552 // Add a version 1 app first. |
546 RunAddNewAppTest(kTestLocalFsKioskApp, "1.0.0", kTestLocalFsKioskAppName); | 553 RunAddNewAppTest(kTestLocalFsKioskApp, "1.0.0", kTestLocalFsKioskAppName); |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
608 ASSERT_EQ(1u, apps.size()); | 615 ASSERT_EQ(1u, apps.size()); |
609 base::FilePath v2_crx_path; | 616 base::FilePath v2_crx_path; |
610 std::string new_version; | 617 std::string new_version; |
611 EXPECT_TRUE(GetCachedCrx(kTestLocalFsKioskApp, &v2_crx_path, &new_version)); | 618 EXPECT_TRUE(GetCachedCrx(kTestLocalFsKioskApp, &v2_crx_path, &new_version)); |
612 EXPECT_EQ("2.0.0", new_version); | 619 EXPECT_EQ("2.0.0", new_version); |
613 // Verify both v1 and v2 crx files exist. | 620 // Verify both v1 and v2 crx files exist. |
614 EXPECT_TRUE(base::PathExists(v1_crx_path)); | 621 EXPECT_TRUE(base::PathExists(v1_crx_path)); |
615 EXPECT_TRUE(base::PathExists(v2_crx_path)); | 622 EXPECT_TRUE(base::PathExists(v2_crx_path)); |
616 | 623 |
617 // Remove the app now. | 624 // Remove the app now. |
618 manager()->RemoveApp(kTestLocalFsKioskApp); | 625 manager()->RemoveApp(kTestLocalFsKioskApp, owner_settings_service_.get()); |
619 content::RunAllBlockingPoolTasksUntilIdle(); | 626 content::RunAllBlockingPoolTasksUntilIdle(); |
620 manager()->GetApps(&apps); | 627 manager()->GetApps(&apps); |
621 ASSERT_EQ(0u, apps.size()); | 628 ASSERT_EQ(0u, apps.size()); |
622 // Verify both v1 and v2 crx files are removed. | 629 // Verify both v1 and v2 crx files are removed. |
623 EXPECT_FALSE(base::PathExists(v1_crx_path)); | 630 EXPECT_FALSE(base::PathExists(v1_crx_path)); |
624 EXPECT_FALSE(base::PathExists(v2_crx_path)); | 631 EXPECT_FALSE(base::PathExists(v2_crx_path)); |
625 EXPECT_FALSE(GetCachedCrx(kTestLocalFsKioskApp, &v2_crx_path, &version)); | 632 EXPECT_FALSE(GetCachedCrx(kTestLocalFsKioskApp, &v2_crx_path, &version)); |
626 } | 633 } |
627 | 634 |
628 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, EnableConsumerKiosk) { | 635 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, EnableConsumerKiosk) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
696 manager()->GetConsumerKioskAutoLaunchStatus( | 703 manager()->GetConsumerKioskAutoLaunchStatus( |
697 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, | 704 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, |
698 status.get(), | 705 status.get(), |
699 runner3->QuitClosure())); | 706 runner3->QuitClosure())); |
700 runner3->Run(); | 707 runner3->Run(); |
701 EXPECT_EQ(*status.get(), | 708 EXPECT_EQ(*status.get(), |
702 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); | 709 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); |
703 } | 710 } |
704 | 711 |
705 } // namespace chromeos | 712 } // namespace chromeos |
OLD | NEW |