Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(131)

Side by Side Diff: chrome/browser/chromeos/login/kiosk_browsertest.cc

Issue 2318223003: mash: Migrate wallpaper controllers to ash/common. (Closed)
Patch Set: Fix nit. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <memory> 5 #include <memory>
6 #include <vector> 6 #include <vector>
7 7
8 #include "ash/shell.h" 8 #include "ash/common/wallpaper/wallpaper_controller.h"
9 #include "ash/wallpaper/wallpaper_controller.h" 9 #include "ash/common/wallpaper/wallpaper_controller_observer.h"
10 #include "ash/wallpaper/wallpaper_controller_observer.h" 10 #include "ash/common/wm_shell.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/bind_helpers.h" 12 #include "base/bind_helpers.h"
13 #include "base/files/file_util.h" 13 #include "base/files/file_util.h"
14 #include "base/location.h" 14 #include "base/location.h"
15 #include "base/macros.h" 15 #include "base/macros.h"
16 #include "base/path_service.h" 16 #include "base/path_service.h"
17 #include "base/run_loop.h" 17 #include "base/run_loop.h"
18 #include "base/strings/string_number_conversions.h" 18 #include "base/strings/string_number_conversions.h"
19 #include "base/strings/string_util.h" 19 #include "base/strings/string_util.h"
20 #include "base/synchronization/lock.h" 20 #include "base/synchronization/lock.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 #include "extensions/browser/app_window/native_app_window.h" 71 #include "extensions/browser/app_window/native_app_window.h"
72 #include "extensions/browser/extension_system.h" 72 #include "extensions/browser/extension_system.h"
73 #include "extensions/common/manifest.h" 73 #include "extensions/common/manifest.h"
74 #include "extensions/components/native_app_window/native_app_window_views.h" 74 #include "extensions/components/native_app_window/native_app_window_views.h"
75 #include "extensions/test/extension_test_message_listener.h" 75 #include "extensions/test/extension_test_message_listener.h"
76 #include "extensions/test/result_catcher.h" 76 #include "extensions/test/result_catcher.h"
77 #include "google_apis/gaia/gaia_constants.h" 77 #include "google_apis/gaia/gaia_constants.h"
78 #include "google_apis/gaia/gaia_switches.h" 78 #include "google_apis/gaia/gaia_switches.h"
79 #include "google_apis/gaia/gaia_urls.h" 79 #include "google_apis/gaia/gaia_urls.h"
80 #include "net/test/embedded_test_server/embedded_test_server.h" 80 #include "net/test/embedded_test_server/embedded_test_server.h"
81 #include "ui/aura/window.h"
81 #include "ui/base/accelerators/accelerator.h" 82 #include "ui/base/accelerators/accelerator.h"
82 83
83 namespace em = enterprise_management; 84 namespace em = enterprise_management;
84 85
85 namespace chromeos { 86 namespace chromeos {
86 87
87 namespace { 88 namespace {
88 89
89 // This is a simple test app that creates an app window and immediately closes 90 // This is a simple test app that creates an app window and immediately closes
90 // it again. Webstore data json is in 91 // it again. Webstore data json is in
(...skipping 2248 matching lines...) Expand 10 before | Expand all | Expand 10 after
2339 // KioskTest overrides: 2340 // KioskTest overrides:
2340 void SetUpCommandLine(base::CommandLine* command_line) override { 2341 void SetUpCommandLine(base::CommandLine* command_line) override {
2341 KioskTest::SetUpCommandLine(command_line); 2342 KioskTest::SetUpCommandLine(command_line);
2342 command_line->AppendSwitch(switches::kDisableBootAnimation); 2343 command_line->AppendSwitch(switches::kDisableBootAnimation);
2343 } 2344 }
2344 2345
2345 void SetUpOnMainThread() override { 2346 void SetUpOnMainThread() override {
2346 LoginDisplayHostImpl::DisableRestrictiveProxyCheckForTest(); 2347 LoginDisplayHostImpl::DisableRestrictiveProxyCheckForTest();
2347 2348
2348 KioskTest::SetUpOnMainThread(); 2349 KioskTest::SetUpOnMainThread();
2349 ash::Shell::GetInstance()->wallpaper_controller()->AddObserver(this); 2350 ash::WmShell::Get()->wallpaper_controller()->AddObserver(this);
2350 } 2351 }
2351 2352
2352 void TearDownOnMainThread() override { 2353 void TearDownOnMainThread() override {
2353 ash::Shell::GetInstance()->wallpaper_controller()->RemoveObserver(this); 2354 ash::WmShell::Get()->wallpaper_controller()->RemoveObserver(this);
2354 KioskTest::TearDownOnMainThread(); 2355 KioskTest::TearDownOnMainThread();
2355 } 2356 }
2356 2357
2357 void WaitForWallpaper() { 2358 void WaitForWallpaper() {
2358 if (!wallpaper_loaded_) { 2359 if (!wallpaper_loaded_) {
2359 runner_ = new content::MessageLoopRunner; 2360 runner_ = new content::MessageLoopRunner;
2360 runner_->Run(); 2361 runner_->Run();
2361 } 2362 }
2362 } 2363 }
2363 2364
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
2401 content::WindowedNotificationObserver( 2402 content::WindowedNotificationObserver(
2402 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE, 2403 chrome::NOTIFICATION_KIOSK_AUTOLAUNCH_WARNING_VISIBLE,
2403 content::NotificationService::AllSources()).Wait(); 2404 content::NotificationService::AllSources()).Wait();
2404 2405
2405 // Wait for the wallpaper to load. 2406 // Wait for the wallpaper to load.
2406 WaitForWallpaper(); 2407 WaitForWallpaper();
2407 EXPECT_TRUE(wallpaper_loaded()); 2408 EXPECT_TRUE(wallpaper_loaded());
2408 } 2409 }
2409 2410
2410 } // namespace chromeos 2411 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698