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

Side by Side 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: merge with the trunk 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" 5 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
6 6
7 #include "base/metrics/histogram_samples.h" 7 #include "base/metrics/histogram_samples.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_test.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_test.h"
10 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h"
10 #include "chrome/browser/ui/tabs/tab_strip_model.h" 11 #include "chrome/browser/ui/tabs/tab_strip_model.h"
11 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
12 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h" 13 #include "chrome/browser/ui/views/passwords/manage_passwords_bubble_view.h"
13 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h" 14 #include "chrome/browser/ui/views/passwords/manage_passwords_icon_view.h"
14 #include "chrome/browser/ui/views/toolbar/toolbar_view.h" 15 #include "chrome/browser/ui/views/toolbar/toolbar_view.h"
15 #include "chrome/test/base/interactive_test_utils.h" 16 #include "chrome/test/base/interactive_test_utils.h"
16 #include "components/password_manager/core/browser/password_manager_metrics_util .h" 17 #include "components/password_manager/core/browser/password_manager_metrics_util .h"
17 #include "components/password_manager/core/browser/stub_password_manager_client. h" 18 #include "components/password_manager/core/browser/stub_password_manager_client. h"
18 #include "content/public/browser/notification_types.h" 19 #include "content/public/browser/notification_types.h"
19 #include "content/public/browser/render_view_host.h" 20 #include "content/public/browser/render_view_host.h"
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 net::FakeURLFetcherFactory factory( 308 net::FakeURLFetcherFactory factory(
308 NULL, 309 NULL,
309 base::Bind(&TestURLFetcherCallback::CreateURLFetcher, 310 base::Bind(&TestURLFetcherCallback::CreateURLFetcher,
310 base::Unretained(&url_callback))); 311 base::Unretained(&url_callback)));
311 factory.SetFakeResponse(avatar_url, std::string(), net::HTTP_OK, 312 factory.SetFakeResponse(avatar_url, std::string(), net::HTTP_OK,
312 net::URLRequestStatus::FAILED); 313 net::URLRequestStatus::FAILED);
313 EXPECT_CALL(url_callback, OnRequestDone(avatar_url)); 314 EXPECT_CALL(url_callback, OnRequestDone(avatar_url));
314 315
315 SetupAutoSignin(local_credentials.Pass()); 316 SetupAutoSignin(local_credentials.Pass());
316 EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing()); 317 EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
318 ::testing::Mock::VerifyAndClearExpectations(&url_callback);
319
320 ManagePasswordsBubbleView::CloseBubble();
321 EXPECT_FALSE(ManagePasswordsBubbleView::IsShowing());
322 content::RunAllPendingInMessageLoop();
323
324 // Open the bubble to manage accounts.
325 EXPECT_EQ(password_manager::ui::MANAGE_STATE, GetController()->state());
326 EXPECT_CALL(url_callback, OnRequestDone(avatar_url));
Mike West 2015/03/18 08:33:51 This expectation is failing. Perhaps you need to p
vasilii 2015/03/18 09:25:09 No, we were opening the old UI without avatars.
327 ManagePasswordsBubbleView::ShowBubble(
328 browser()->tab_strip_model()->GetActiveWebContents(),
329 ManagePasswordsBubble::USER_ACTION);
330 EXPECT_TRUE(ManagePasswordsBubbleView::IsShowing());
317 } 331 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698