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

Side by Side Diff: chrome/browser/ui/passwords/manage_passwords_bubble_model_unittest.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 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 "base/metrics/histogram_samples.h" 5 #include "base/metrics/histogram_samples.h"
6 #include "base/prefs/pref_service.h" 6 #include "base/prefs/pref_service.h"
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "base/test/histogram_tester.h" 8 #include "base/test/histogram_tester.h"
9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h" 9 #include "chrome/browser/ui/passwords/manage_passwords_bubble.h"
10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h" 10 #include "chrome/browser/ui/passwords/manage_passwords_bubble_model.h"
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 model_->OnAutoSignInToastTimeout(); 285 model_->OnAutoSignInToastTimeout();
286 model_->OnBubbleHidden(); 286 model_->OnBubbleHidden();
287 EXPECT_EQ(model_->dismissal_reason(), 287 EXPECT_EQ(model_->dismissal_reason(),
288 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT); 288 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT);
289 289
290 histogram_tester.ExpectUniqueSample( 290 histogram_tester.ExpectUniqueSample(
291 kUIDismissalReasonMetric, 291 kUIDismissalReasonMetric,
292 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT, 292 password_manager::metrics_util::AUTO_SIGNIN_TOAST_TIMEOUT,
293 1); 293 1);
294 } 294 }
295
296 TEST_F(ManagePasswordsBubbleModelTest, PopupAutoSigninAndManagedBubble) {
297 base::HistogramTester histogram_tester;
298 PretendAutoSigningIn();
299 model_->OnAutoSignInToastTimeout();
300 model_->OnAutoSignInClicked();
301 EXPECT_EQ(model_->dismissal_reason(),
302 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED);
303 model_->OnBubbleHidden();
304
305 EXPECT_TRUE(controller()->manage_accounts());
306
307 histogram_tester.ExpectUniqueSample(
308 kUIDismissalReasonMetric,
309 password_manager::metrics_util::AUTO_SIGNIN_TOAST_CLICKED,
310 1);
311 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/passwords/manage_passwords_bubble_model.cc ('k') | chrome/browser/ui/passwords/manage_passwords_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698