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

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

Issue 952023002: Credential Manager API: pop up the new "Manage accounts" bubble. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix the test Created 5 years, 9 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_bubble_view_browsertest.cc
diff --git a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
index d8e550d12cc6cc2b8998f77fb142209e4bbfd86c..a7e80b3d0faed6ab49ab4df88e60aa4adc5a2e7d 100644
--- a/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
+++ b/chrome/browser/ui/views/passwords/manage_passwords_bubble_view_browsertest.cc
@@ -4,9 +4,11 @@
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
+#include "base/command_line.h"
#include "base/metrics/histogram_samples.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/passwords/manage_passwords_test.h"
+#include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
@@ -17,6 +19,7 @@
#include "components/password_manager/core/browser/stub_password_manager_client.h"
#include "content/public/browser/notification_types.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/common/content_switches.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -294,6 +297,9 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, ChooseCredential) {
}
IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, AutoSignin) {
+ // The switch enables the new UI.
+ base::CommandLine::ForCurrentProcess()->AppendSwitch(
+ switches::kEnableCredentialManagerAPI);
ScopedVector<autofill::PasswordForm> local_credentials;
test_form()->origin = GURL("https://example.com");
test_form()->display_name = base::ASCIIToUTF16("Peter");
@@ -314,4 +320,17 @@ IN_PROC_BROWSER_TEST_F(ManagePasswordsBubbleViewTest, AutoSignin) {
SetupAutoSignin(local_credentials.Pass());
EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
+ ::testing::Mock::VerifyAndClearExpectations(&url_callback);
+
+ ManagePasswordsBubbleView::CloseBubble();
+ EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing());
+ content::RunAllPendingInMessageLoop();
+
+ // Open the bubble to manage accounts.
+ EXPECT_EQ(password_manager::ui::MANAGE_STATE, GetController()->state());
+ EXPECT_CALL(url_callback, OnRequestDone(avatar_url));
+ ManagePasswordsBubbleView::ShowBubble(
+ browser()->tab_strip_model()->GetActiveWebContents(),
+ ManagePasswordsBubble::USER_ACTION);
+ EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
}

Powered by Google App Engine
This is Rietveld 408576698