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/file_util.h" | 8 #include "base/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" |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 waiter.Wait(); | 478 waiter.Wait(); |
479 EXPECT_TRUE(waiter.loaded()); | 479 EXPECT_TRUE(waiter.loaded()); |
480 | 480 |
481 manager()->GetApps(&apps); | 481 manager()->GetApps(&apps); |
482 EXPECT_EQ(1u, apps.size()); | 482 EXPECT_EQ(1u, apps.size()); |
483 EXPECT_EQ("app_1", apps[0].app_id); | 483 EXPECT_EQ("app_1", apps[0].app_id); |
484 EXPECT_EQ("Updated App1 Name", apps[0].name); | 484 EXPECT_EQ("Updated App1 Name", apps[0].name); |
485 } | 485 } |
486 | 486 |
487 // Test is flaky. See http://crbug.com/379769 for details. | 487 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, BadApp) { |
488 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, DISABLED_BadApp) { | |
489 AppDataLoadWaiter waiter(manager(), 2); | 488 AppDataLoadWaiter waiter(manager(), 2); |
490 manager()->AddApp("unknown_app"); | 489 manager()->AddApp("unknown_app"); |
491 TestKioskAppManagerObserver observer(manager()); | 490 TestKioskAppManagerObserver observer(manager()); |
492 waiter.Wait(); | 491 waiter.Wait(); |
493 EXPECT_FALSE(waiter.loaded()); | 492 EXPECT_FALSE(waiter.loaded()); |
494 | 493 |
495 EXPECT_EQ("", GetAppIds()); | 494 EXPECT_EQ("", GetAppIds()); |
496 EXPECT_EQ(1, observer.load_failure_count()); | 495 EXPECT_LE(1, observer.load_failure_count()); |
497 } | 496 } |
498 | 497 |
499 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, GoodApp) { | 498 IN_PROC_BROWSER_TEST_F(KioskAppManagerTest, GoodApp) { |
500 // Webstore data json is in | 499 // Webstore data json is in |
501 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/detail/app_1 | 500 // chrome/test/data/chromeos/app_mode/webstore/inlineinstall/detail/app_1 |
502 fake_cws()->SetNoUpdate("app_1"); | 501 fake_cws()->SetNoUpdate("app_1"); |
503 AppDataLoadWaiter waiter(manager(), 2); | 502 AppDataLoadWaiter waiter(manager(), 2); |
504 manager()->AddApp("app_1"); | 503 manager()->AddApp("app_1"); |
505 waiter.Wait(); | 504 waiter.Wait(); |
506 EXPECT_TRUE(waiter.loaded()); | 505 EXPECT_TRUE(waiter.loaded()); |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
714 manager()->GetConsumerKioskAutoLaunchStatus( | 713 manager()->GetConsumerKioskAutoLaunchStatus( |
715 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, | 714 base::Bind(&ConsumerKioskAutoLaunchStatusCheck, |
716 status.get(), | 715 status.get(), |
717 runner3->QuitClosure())); | 716 runner3->QuitClosure())); |
718 runner3->Run(); | 717 runner3->Run(); |
719 EXPECT_EQ(*status.get(), | 718 EXPECT_EQ(*status.get(), |
720 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); | 719 KioskAppManager::CONSUMER_KIOSK_AUTO_LAUNCH_DISABLED); |
721 } | 720 } |
722 | 721 |
723 } // namespace chromeos | 722 } // namespace chromeos |
OLD | NEW |