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

Unified Diff: chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc

Issue 1991973002: [Sync] Add histograms for cookie jar state on Sessions commit (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update histogram enums Created 4 years, 7 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
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
diff --git a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
index b21a6236f570b52178fd5cd798faaa103abe5e87..d4d30c66e38d5400cf19367c8627fb943a979aff 100644
--- a/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
+++ b/chrome/browser/sync/test/integration/single_client_sessions_sync_test.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/macros.h"
+#include "base/test/histogram_tester.h"
#include "chrome/browser/sessions/session_service.h"
#include "chrome/browser/sync/test/integration/profile_sync_service_harness.h"
#include "chrome/browser/sync/test/integration/sessions_helper.h"
@@ -160,6 +161,7 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, CookieJarMismatch) {
ASSERT_TRUE(CheckInitialState(0));
// Add a new session to client 0 and wait for it to sync.
+ base::HistogramTester histogram_tester;
ScopedWindowMap old_windows;
GURL url = GURL("http://127.0.0.1/bubba");
ASSERT_TRUE(OpenTabAndGetLocalWindows(0, url, old_windows.GetMutable()));
@@ -172,6 +174,10 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, CookieJarMismatch) {
sync_pb::ClientToServerMessage message;
ASSERT_TRUE(GetFakeServer()->GetLastCommitMessage(&message));
ASSERT_TRUE(message.commit().config_params().cookie_jar_mismatch());
+ histogram_tester.ExpectUniqueSample("Sync.CookieJarMatchOnNavigation",
+ false, 1);
maxbogue 2016/05/18 22:14:48 Nit: this line should be moved right one space (an
Nicolas Zea 2016/05/18 22:18:28 Done.
+ histogram_tester.ExpectUniqueSample("Sync.CookieJarEmptyOnMismatch",
+ true, 1);
// Trigger a cookie jar change (user signing in to content area).
gaia::ListedAccount signed_in_account;
@@ -191,4 +197,11 @@ IN_PROC_BROWSER_TEST_F(SingleClientSessionsSyncTest, CookieJarMismatch) {
// Verify the cookie jar mismatch bool is set to false.
ASSERT_TRUE(GetFakeServer()->GetLastCommitMessage(&message));
ASSERT_FALSE(message.commit().config_params().cookie_jar_mismatch());
+
+ // Verify the histograms were recorded properly.
+ histogram_tester.ExpectTotalCount("Sync.CookieJarMatchOnNavigation", 2);
+ histogram_tester.ExpectBucketCount("Sync.CookieJarMatchOnNavigation",
+ true, 1);
+ histogram_tester.ExpectUniqueSample("Sync.CookieJarEmptyOnMismatch",
+ true, 1);
}
« no previous file with comments | « no previous file | components/browser_sync/browser/profile_sync_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698