| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ash/desktop_background/desktop_background_controller.h" | 5 #include "ash/desktop_background/desktop_background_controller.h" |
| 6 #include "ash/desktop_background/desktop_background_controller_observer.h" | 6 #include "ash/desktop_background/desktop_background_controller_observer.h" |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "base/bind.h" | 8 #include "base/bind.h" |
| 9 #include "base/bind_helpers.h" | 9 #include "base/bind_helpers.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); | 329 AppLaunchController::SetNetworkTimeoutCallbackForTesting(NULL); |
| 330 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); | 330 AppLaunchSigninScreen::SetUserManagerForTesting(NULL); |
| 331 | 331 |
| 332 OobeBaseTest::TearDownOnMainThread(); | 332 OobeBaseTest::TearDownOnMainThread(); |
| 333 | 333 |
| 334 // Clean up while main thread still runs. | 334 // Clean up while main thread still runs. |
| 335 // See http://crbug.com/176659. | 335 // See http://crbug.com/176659. |
| 336 KioskAppManager::Get()->CleanUp(); | 336 KioskAppManager::Get()->CleanUp(); |
| 337 } | 337 } |
| 338 | 338 |
| 339 virtual void SetUpCommandLine(CommandLine* command_line) override { | 339 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 340 OobeBaseTest::SetUpCommandLine(command_line); | 340 OobeBaseTest::SetUpCommandLine(command_line); |
| 341 fake_cws_->Init(embedded_test_server()); | 341 fake_cws_->Init(embedded_test_server()); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { | 344 void LaunchApp(const std::string& app_id, bool diagnostic_mode) { |
| 345 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); | 345 bool new_kiosk_ui = KioskAppMenuHandler::EnableNewKioskUI(); |
| 346 GetLoginUI()->CallJavascriptFunction(new_kiosk_ui ? | 346 GetLoginUI()->CallJavascriptFunction(new_kiosk_ui ? |
| 347 kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, | 347 kLaunchAppForTestNewAPI : kLaunchAppForTestOldAPI, |
| 348 base::StringValue(app_id), | 348 base::StringValue(app_id), |
| 349 base::FundamentalValue(diagnostic_mode)); | 349 base::FundamentalValue(diagnostic_mode)); |
| (...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1767 } | 1767 } |
| 1768 | 1768 |
| 1769 // Specialized test fixture for testing kiosk mode on the | 1769 // Specialized test fixture for testing kiosk mode on the |
| 1770 // hidden WebUI initialization flow for slow hardware. | 1770 // hidden WebUI initialization flow for slow hardware. |
| 1771 class KioskHiddenWebUITest : public KioskTest, | 1771 class KioskHiddenWebUITest : public KioskTest, |
| 1772 public ash::DesktopBackgroundControllerObserver { | 1772 public ash::DesktopBackgroundControllerObserver { |
| 1773 public: | 1773 public: |
| 1774 KioskHiddenWebUITest() : wallpaper_loaded_(false) {} | 1774 KioskHiddenWebUITest() : wallpaper_loaded_(false) {} |
| 1775 | 1775 |
| 1776 // KioskTest overrides: | 1776 // KioskTest overrides: |
| 1777 virtual void SetUpCommandLine(CommandLine* command_line) override { | 1777 virtual void SetUpCommandLine(base::CommandLine* command_line) override { |
| 1778 KioskTest::SetUpCommandLine(command_line); | 1778 KioskTest::SetUpCommandLine(command_line); |
| 1779 command_line->AppendSwitch(switches::kDisableBootAnimation); | 1779 command_line->AppendSwitch(switches::kDisableBootAnimation); |
| 1780 } | 1780 } |
| 1781 | 1781 |
| 1782 virtual void SetUpOnMainThread() override { | 1782 virtual void SetUpOnMainThread() override { |
| 1783 KioskTest::SetUpOnMainThread(); | 1783 KioskTest::SetUpOnMainThread(); |
| 1784 ash::Shell::GetInstance()->desktop_background_controller() | 1784 ash::Shell::GetInstance()->desktop_background_controller() |
| 1785 ->AddObserver(this); | 1785 ->AddObserver(this); |
| 1786 } | 1786 } |
| 1787 | 1787 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1839 content::WindowedNotificationObserver( | 1839 content::WindowedNotificationObserver( |
| 1840 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, | 1840 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, |
| 1841 content::NotificationService::AllSources()).Wait(); | 1841 content::NotificationService::AllSources()).Wait(); |
| 1842 | 1842 |
| 1843 // Wait for the wallpaper to load. | 1843 // Wait for the wallpaper to load. |
| 1844 WaitForWallpaper(); | 1844 WaitForWallpaper(); |
| 1845 EXPECT_TRUE(wallpaper_loaded()); | 1845 EXPECT_TRUE(wallpaper_loaded()); |
| 1846 } | 1846 } |
| 1847 | 1847 |
| 1848 } // namespace chromeos | 1848 } // namespace chromeos |
| OLD | NEW |