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

Side by Side Diff: chrome/browser/performance_monitor/performance_monitor_browsertest.cc

Issue 10829078: CPM Page Load timing (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_event_refactor
Patch Set: Nits + Latest master for CQ Created 8 years, 4 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
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/path_service.h" 8 #include "base/path_service.h"
9 #include "base/string_number_conversions.h" 9 #include "base/string_number_conversions.h"
10 #include "base/threading/sequenced_worker_pool.h" 10 #include "base/threading/sequenced_worker_pool.h"
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after
694 694
695 Database::MetricInfoVector metrics = GetStats(METRIC_TEST_STARTUP_TIME); 695 Database::MetricInfoVector metrics = GetStats(METRIC_TEST_STARTUP_TIME);
696 ASSERT_EQ(1u, metrics.size()); 696 ASSERT_EQ(1u, metrics.size());
697 ASSERT_LT(metrics[0].value, kMaxStartupTime.ToInternalValue()); 697 ASSERT_LT(metrics[0].value, kMaxStartupTime.ToInternalValue());
698 698
699 metrics = GetStats(METRIC_SESSION_RESTORE_TIME); 699 metrics = GetStats(METRIC_SESSION_RESTORE_TIME);
700 ASSERT_EQ(1u, metrics.size()); 700 ASSERT_EQ(1u, metrics.size());
701 ASSERT_LT(metrics[0].value, kMaxStartupTime.ToInternalValue()); 701 ASSERT_LT(metrics[0].value, kMaxStartupTime.ToInternalValue());
702 } 702 }
703 703
704 IN_PROC_BROWSER_TEST_F(PerformanceMonitorBrowserTest, PageLoadTime) {
705 const base::TimeDelta kMaxLoadTime = base::TimeDelta::FromSeconds(30);
706
707 ui_test_utils::NavigateToURL(
708 browser(),
709 ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
710 FilePath(FILE_PATH_LITERAL("title1.html"))));
711
712 ui_test_utils::NavigateToURL(
713 browser(),
714 ui_test_utils::GetTestUrl(FilePath(FilePath::kCurrentDirectory),
715 FilePath(FILE_PATH_LITERAL("title2.html"))));
716
717 Database::MetricInfoVector metrics = GetStats(METRIC_PAGE_LOAD_TIME);
718
719 ASSERT_EQ(2u, metrics.size());
720 ASSERT_LT(metrics[0].value, kMaxLoadTime.ToInternalValue());
721 ASSERT_LT(metrics[1].value, kMaxLoadTime.ToInternalValue());
722 }
723
704 } // namespace performance_monitor 724 } // namespace performance_monitor
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698