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

Unified Diff: chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc

Issue 2530343005: Hide notification tray when the user flow doesn't allow (Closed)
Patch Set: Add a test Created 4 years 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 | « ash/common/system/web_notification/web_notification_tray.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
diff --git a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
index d0b0e410e99776f683003aaf202fcfb8ea9f9e71..782198a079e8e1d396c90098c3e7b0bc2d6c0688 100644
--- a/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
+++ b/chrome/browser/chromeos/login/supervised/supervised_user_creation_browsertest.cc
@@ -4,6 +4,9 @@
#include <string>
+#include "ash/common/system/status_area_widget.h"
+#include "ash/common/system/web_notification/web_notification_tray.h"
+#include "ash/test/status_area_widget_test_helper.h"
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "base/run_loop.h"
@@ -41,6 +44,16 @@ using chromeos::kTestManager;
namespace chromeos {
+namespace {
+
+bool GetWebNotificationTrayVisibility() {
+ return ash::StatusAreaWidgetTestHelper::GetStatusAreaWidget()
+ ->web_notification_tray()
+ ->visible();
+}
+
+} // anonymous namespace
+
class SupervisedUserCreationTest : public SupervisedUserTestBase {
public:
SupervisedUserCreationTest() : SupervisedUserTestBase() {}
@@ -184,6 +197,38 @@ IN_PROC_BROWSER_TEST_F(SupervisedUserTransactionCleanupTest,
JSEvalOrExitBrowser("$('supervised-user-creation').cancel()");
}
+IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest,
+ PRE_PRE_PRE_CheckNoNotificationTray) {
+ PrepareUsers();
+}
+
+IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest,
+ PRE_PRE_CheckNoNotificationTray) {
+ // Before sign-in, the tray should not be visible.
+ EXPECT_FALSE(GetWebNotificationTrayVisibility());
+
+ StartFlowLoginAsManager();
+
+ // On supervised user creation flow, the tray should not be visible.
+ EXPECT_FALSE(GetWebNotificationTrayVisibility());
+
+ FillNewUserData(kTestSupervisedUserDisplayName);
+ StartUserCreation("supervised-user-creation-next-button",
+ kTestSupervisedUserDisplayName);
+}
+
+IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest,
+ PRE_CheckNoNotificationTray) {
+ SigninAsSupervisedUser(true, 0, kTestSupervisedUserDisplayName);
+
+ // After sign-in, the tray should be visible.
+ EXPECT_TRUE(GetWebNotificationTrayVisibility());
+}
+
+IN_PROC_BROWSER_TEST_F(SupervisedUserCreationTest, CheckNoNotificationTray) {
+ RemoveSupervisedUser(3, 0, kTestSupervisedUserDisplayName);
+}
+
IN_PROC_BROWSER_TEST_(
SupervisedUserTransactionCleanupTest,
CreateAndCancelSupervisedUser,
« no previous file with comments | « ash/common/system/web_notification/web_notification_tray.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698