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

Side by Side Diff: chrome/browser/ui/views/ash/status_area_host_aura_browsertest.cc

Issue 10056001: chromeos: Remove old status-area related code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "ash/shell.h"
6 #include "base/command_line.h"
7 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/chromeos/status/status_area_button.h"
9 #include "chrome/browser/profiles/profile_manager.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_window.h"
12 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
13 #include "chrome/browser/ui/views/ash/status_area_host_aura.h"
14 #include "chrome/common/chrome_notification_types.h"
15 #include "chrome/common/chrome_switches.h"
16 #include "chrome/test/base/in_process_browser_test.h"
17 #include "chrome/test/base/ui_test_utils.h"
18 #include "content/public/browser/notification_service.h"
19 #include "ui/gfx/size.h"
20
21 #if defined(OS_CHROMEOS)
22 #include "base/chromeos/chromeos_version.h"
23 #include "chrome/browser/chromeos/login/screen_locker.h"
24 #include "chrome/browser/chromeos/login/screen_locker_tester.h"
25 #include "chrome/browser/chromeos/login/user_manager.h"
26 #endif
27
28 typedef InProcessBrowserTest StatusAreaHostAuraTest;
29
30 IN_PROC_BROWSER_TEST_F(StatusAreaHostAuraTest, TextStyle) {
31 ChromeShellDelegate* delegate = static_cast<ChromeShellDelegate*>(
32 ash::Shell::GetInstance()->delegate());
33 StatusAreaHostAura* host = delegate->status_area_host();
34
35 #if defined(OS_CHROMEOS)
36 ASSERT_TRUE(!chromeos::UserManager::Get()->IsUserLoggedIn() ||
37 chromeos::UserManager::Get()->IsLoggedInAsStub());
38 if (base::chromeos::IsRunningOnChromeOS()) {
39 EXPECT_EQ(StatusAreaButton::GRAY_PLAIN_LIGHT,
40 host->GetStatusAreaTextStyle());
41 } else {
42 EXPECT_EQ(StatusAreaButton::WHITE_HALOED_BOLD,
43 host->GetStatusAreaTextStyle());
44 }
45
46 // ProfileManager expects a profile dir to be set on Chrome OS.
47 CommandLine::ForCurrentProcess()->AppendSwitchNative(
48 switches::kLoginProfile, "StatusAreaHostAuraTest");
49 chromeos::UserManager::Get()->UserLoggedIn("foo@example.com");
50 ASSERT_TRUE(chromeos::UserManager::Get()->IsUserLoggedIn() &&
51 !chromeos::UserManager::Get()->IsLoggedInAsStub());
52 #endif
53
54 Browser* browser = CreateBrowser(ProfileManager::GetDefaultProfile());
55 EXPECT_EQ(StatusAreaButton::WHITE_HALOED_BOLD,
56 host->GetStatusAreaTextStyle());
57
58 #if defined(OS_CHROMEOS)
59 // Lock the screen.
60 chromeos::ScreenLocker::Show();
61 scoped_ptr<chromeos::test::ScreenLockerTester> tester(
62 chromeos::ScreenLocker::GetTester());
63 tester->EmulateWindowManagerReady();
64 ui_test_utils::WindowedNotificationObserver lock_state_observer(
65 chrome::NOTIFICATION_SCREEN_LOCK_STATE_CHANGED,
66 content::NotificationService::AllSources());
67 if (!tester->IsLocked())
68 lock_state_observer.Wait();
69 ASSERT_TRUE(tester->IsLocked());
70 EXPECT_EQ(StatusAreaButton::GRAY_PLAIN_LIGHT, host->GetStatusAreaTextStyle());
71
72 chromeos::ScreenLocker::Hide();
73 ui_test_utils::RunAllPendingInMessageLoop();
74 ASSERT_FALSE(tester->IsLocked());
75
76 EXPECT_EQ(StatusAreaButton::WHITE_HALOED_BOLD,
77 host->GetStatusAreaTextStyle());
78 #endif
79
80 browser->CloseWindow();
81 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/status_area_host_aura.cc ('k') | chrome/browser/ui/webui/chromeos/login/network_screen_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698