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

Unified Diff: chrome/browser/chromeos/login/login_browsertest.cc

Issue 922463005: Ash Tray Browser Test (Retry) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/login_browsertest.cc
diff --git a/chrome/browser/chromeos/login/login_browsertest.cc b/chrome/browser/chromeos/login/login_browsertest.cc
index 2c0d1a580e0ae0790bee4339acab91e0d4eef98c..a66cd30fc5d0c7c3e71e4344486b2e22e7d33432 100644
--- a/chrome/browser/chromeos/login/login_browsertest.cc
+++ b/chrome/browser/chromeos/login/login_browsertest.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "ash/shell.h"
+#include "ash/system/tray/system_tray.h"
#include "base/command_line.h"
#include "base/strings/string_util.h"
#include "chrome/browser/chrome_notification_types.h"
@@ -142,6 +143,15 @@ class LoginTest : public chromeos::LoginManagerTest {
}
};
+// Used to make sure that the system tray is visible and within the screen
+// bounds after login.
+void TestSystemTrayIsVisible() {
+ ash::SystemTray* tray = ash::Shell::GetInstance()->GetPrimarySystemTray();
+ aura::Window* primary_win = ash::Shell::GetPrimaryRootWindow();
+ EXPECT_TRUE(tray->visible());
+ EXPECT_TRUE(primary_win->bounds().Contains(tray->GetBoundsInScreen()));
+}
+
// After a chrome crash, the session manager will restart chrome with
// the -login-user flag indicating that the user is already logged in.
// This profile should NOT be an OTR profile.
@@ -151,11 +161,15 @@ IN_PROC_BROWSER_TEST_F(LoginUserTest, UserPassed) {
profile_base_path.insert(0, chrome::kProfileDirPrefix);
EXPECT_EQ(profile_base_path, profile->GetPath().BaseName().value());
EXPECT_FALSE(profile->IsOffTheRecord());
+
+ TestSystemTrayIsVisible();
}
// Verifies the cursor is not hidden at startup when user is logged in.
IN_PROC_BROWSER_TEST_F(LoginUserTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+
+ TestSystemTrayIsVisible();
}
// After a guest login, we should get the OTR default profile.
@@ -164,11 +178,15 @@ IN_PROC_BROWSER_TEST_F(LoginGuestTest, GuestIsOTR) {
EXPECT_TRUE(profile->IsOffTheRecord());
// Ensure there's extension service for this profile.
EXPECT_TRUE(extensions::ExtensionSystem::Get(profile)->extension_service());
+
+ TestSystemTrayIsVisible();
}
// Verifies the cursor is not hidden at startup when running guest session.
IN_PROC_BROWSER_TEST_F(LoginGuestTest, CursorShown) {
EXPECT_TRUE(ash::Shell::GetInstance()->cursor_manager()->IsCursorVisible());
+
+ TestSystemTrayIsVisible();
}
// Verifies the cursor is hidden at startup on login screen.
@@ -185,6 +203,8 @@ IN_PROC_BROWSER_TEST_F(LoginCursorTest, CursorHidden) {
base::MessageLoop::current()->DeleteSoon(
FROM_HERE, chromeos::LoginDisplayHostImpl::default_host());
+
+ TestSystemTrayIsVisible();
}
// Verifies that the webui for login comes up successfully.
@@ -219,6 +239,8 @@ IN_PROC_BROWSER_TEST_F(LoginTest, GaiaAuthOffline) {
content::WindowedNotificationObserver(
chrome::NOTIFICATION_SESSION_STARTED,
content::NotificationService::AllSources()).Wait();
+
+ TestSystemTrayIsVisible();
}
} // namespace
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698