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

Unified Diff: chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc

Issue 246393004: Password bubble: Introduce a command to open the bubble. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mac. Created 6 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc b/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc
new file mode 100644
index 0000000000000000000000000000000000000000..e0fc1673a8d7a2790bdf13cbdd4acbfac7963f67
--- /dev/null
+++ b/chrome/browser/ui/views/passwords/manage_passwords_icon_view_browsertest.cc
@@ -0,0 +1,45 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h"
+
+#include "chrome/browser/ui/passwords/manage_passwords_bubble_ui_controller_mock.h"
+#include "chrome/browser/ui/passwords/manage_passwords_icon.h"
+#include "chrome/browser/ui/views/passwords/manage_passwords_view_test.h"
+#include "grit/generated_resources.h"
+#include "grit/theme_resources.h"
+#include "testing/gtest/include/gtest/gtest.h"
+
+typedef ManagePasswordsViewTest ManagePasswordsIconViewTest;
+
+IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, DefaultStateIsInavtive) {
Peter Kasting 2014/04/28 20:07:15 Nit: Inavtive -> Inactive
Mike West 2014/04/29 06:47:18 Done.
+ EXPECT_EQ(ManagePasswordsIcon::INACTIVE_STATE, view()->state());
+ EXPECT_FALSE(view()->visible());
+ EXPECT_EQ(0, view()->icon_id());
+ EXPECT_EQ(0, view()->tooltip_text_id());
+}
+
+IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, PendingState) {
+ SetupPendingPassword();
+ EXPECT_EQ(ManagePasswordsIcon::PENDING_STATE, view()->state());
+ EXPECT_TRUE(view()->visible());
+ EXPECT_EQ(IDR_SAVE_PASSWORD, view()->icon_id());
+ EXPECT_EQ(IDS_PASSWORD_MANAGER_TOOLTIP_SAVE, view()->tooltip_text_id());
+}
+
+IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, ManageState) {
+ SetupManagingPasswords();
+ EXPECT_EQ(ManagePasswordsIcon::MANAGE_STATE, view()->state());
+ EXPECT_TRUE(view()->visible());
+ EXPECT_EQ(IDR_SAVE_PASSWORD, view()->icon_id());
+ EXPECT_EQ(IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE, view()->tooltip_text_id());
+}
+
+IN_PROC_BROWSER_TEST_F(ManagePasswordsIconViewTest, BlacklistedState) {
+ SetupBlackistedPassword();
+ EXPECT_EQ(ManagePasswordsIcon::BLACKLISTED_STATE, view()->state());
+ EXPECT_TRUE(view()->visible());
+ EXPECT_EQ(IDR_SAVE_PASSWORD_BLACKLISTED, view()->icon_id());
+ EXPECT_EQ(IDS_PASSWORD_MANAGER_TOOLTIP_MANAGE, view()->tooltip_text_id());
+}

Powered by Google App Engine
This is Rietveld 408576698