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

Side by Side Diff: chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc

Issue 2350473002: [page_load_metrics] Add support for chrome:// urls and add extensions observer (Closed)
Patch Set: fix about:blank check Created 4 years, 3 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 (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 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/page_load_metrics/metrics_web_contents_observer.h" 5 #include "chrome/browser/page_load_metrics/metrics_web_contents_observer.h"
6 6
7 #include <memory> 7 #include <memory>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 content::WebContentsTester::For(web_contents()); 312 content::WebContentsTester::For(web_contents());
313 313
314 GURL about_blank_url = GURL("about:blank"); 314 GURL about_blank_url = GURL("about:blank");
315 web_contents_tester->NavigateAndCommit(about_blank_url); 315 web_contents_tester->NavigateAndCommit(about_blank_url);
316 SimulateTimingUpdate(timing); 316 SimulateTimingUpdate(timing);
317 ASSERT_EQ(0, CountUpdatedTimingReported()); 317 ASSERT_EQ(0, CountUpdatedTimingReported());
318 web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl)); 318 web_contents_tester->NavigateAndCommit(GURL(kDefaultTestUrl));
319 ASSERT_EQ(0, CountUpdatedTimingReported()); 319 ASSERT_EQ(0, CountUpdatedTimingReported());
320 ASSERT_EQ(0, CountCompleteTimingReported()); 320 ASSERT_EQ(0, CountCompleteTimingReported());
321 321
322 CheckErrorEvent(ERR_IPC_FROM_BAD_URL_SCHEME, 1);
323 CheckErrorEvent(ERR_IPC_WITH_NO_RELEVANT_LOAD, 1); 322 CheckErrorEvent(ERR_IPC_WITH_NO_RELEVANT_LOAD, 1);
324 CheckTotalErrorEvents(); 323 CheckTotalErrorEvents();
325 } 324 }
326 325
327 TEST_F(MetricsWebContentsObserverTest, NotInMainError) { 326 TEST_F(MetricsWebContentsObserverTest, NotInMainError) {
328 PageLoadTiming timing; 327 PageLoadTiming timing;
329 timing.navigation_start = base::Time::FromDoubleT(1); 328 timing.navigation_start = base::Time::FromDoubleT(1);
330 329
331 content::WebContentsTester* web_contents_tester = 330 content::WebContentsTester* web_contents_tester =
332 content::WebContentsTester::For(web_contents()); 331 content::WebContentsTester::For(web_contents());
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 501
503 histogram_tester_.ExpectTotalCount( 502 histogram_tester_.ExpectTotalCount(
504 internal::kPageLoadCompletedAfterAppBackground, 2); 503 internal::kPageLoadCompletedAfterAppBackground, 2);
505 histogram_tester_.ExpectBucketCount( 504 histogram_tester_.ExpectBucketCount(
506 internal::kPageLoadCompletedAfterAppBackground, false, 1); 505 internal::kPageLoadCompletedAfterAppBackground, false, 1);
507 histogram_tester_.ExpectBucketCount( 506 histogram_tester_.ExpectBucketCount(
508 internal::kPageLoadCompletedAfterAppBackground, true, 1); 507 internal::kPageLoadCompletedAfterAppBackground, true, 1);
509 } 508 }
510 509
511 } // namespace page_load_metrics 510 } // namespace page_load_metrics
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698