OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/files/file_path.h" | 6 #include "base/files/file_path.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/time/time.h" | 9 #include "base/time/time.h" |
9 #include "content/browser/frame_host/cross_site_transferring_request.h" | 10 #include "content/browser/frame_host/cross_site_transferring_request.h" |
10 #include "content/browser/frame_host/navigation_before_commit_info.h" | 11 #include "content/browser/frame_host/navigation_before_commit_info.h" |
11 #include "content/browser/frame_host/navigation_controller_impl.h" | 12 #include "content/browser/frame_host/navigation_controller_impl.h" |
12 #include "content/browser/frame_host/navigation_entry_impl.h" | 13 #include "content/browser/frame_host/navigation_entry_impl.h" |
13 #include "content/browser/frame_host/navigation_request.h" | 14 #include "content/browser/frame_host/navigation_request.h" |
14 #include "content/browser/frame_host/navigator.h" | 15 #include "content/browser/frame_host/navigator.h" |
15 #include "content/browser/frame_host/navigator_impl.h" | 16 #include "content/browser/frame_host/navigator_impl.h" |
16 #include "content/browser/frame_host/render_frame_host_manager.h" | 17 #include "content/browser/frame_host/render_frame_host_manager.h" |
17 #include "content/browser/site_instance_impl.h" | 18 #include "content/browser/site_instance_impl.h" |
(...skipping 1835 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1853 render_manager->CommitNavigation(nbc_info); | 1854 render_manager->CommitNavigation(nbc_info); |
1854 EXPECT_EQ(kUrl0_site, main_test_rfh()->GetSiteInstance()->GetSiteURL()); | 1855 EXPECT_EQ(kUrl0_site, main_test_rfh()->GetSiteInstance()->GetSiteURL()); |
1855 | 1856 |
1856 // Confirms that a valid, request-matching commit is correctly processed. | 1857 // Confirms that a valid, request-matching commit is correctly processed. |
1857 nbc_info.navigation_url = kUrl2; | 1858 nbc_info.navigation_url = kUrl2; |
1858 nbc_info.navigation_request_id = request_id2; | 1859 nbc_info.navigation_request_id = request_id2; |
1859 render_manager->CommitNavigation(nbc_info); | 1860 render_manager->CommitNavigation(nbc_info); |
1860 EXPECT_EQ(kUrl2_site, main_test_rfh()->GetSiteInstance()->GetSiteURL()); | 1861 EXPECT_EQ(kUrl2_site, main_test_rfh()->GetSiteInstance()->GetSiteURL()); |
1861 } | 1862 } |
1862 | 1863 |
1864 // PlzNavigate: test that the navigation histograms are being correctly tracked | |
1865 // both for regular and PlzNavigate navigations. | |
1866 // Note that as the IO thread is not really running the | |
nasko
2014/09/24 00:48:07
nit: Usually the format of notes is "Note: "
carlosk
2014/09/24 18:35:50
Done.
| |
1867 // Navigation.TimeToURLJobStart histogram cannot be tracked here. | |
nasko
2014/09/24 00:48:07
This comment reads strangely. Break needed between
carlosk
2014/09/24 18:35:50
I rephrased it to hopefully make it clearer.
nasko
2014/09/24 23:11:21
Much better. Since it is a sentence, I'd start wit
carlosk
2014/09/25 17:26:06
Done: beginning with a capitalized "Tests".
| |
1868 TEST_F(RenderFrameHostManagerTest, | |
clamy
2014/09/23 21:54:07
You could test that two navigation commits result
carlosk
2014/09/24 18:35:50
Done, added that case to the test. IMO this one is
nasko
2014/09/24 23:11:21
I don't quite follow. If PlzNavigate is disabled,
carlosk
2014/09/25 17:26:06
To better clarify what I'm testing with Patch Set
| |
1869 BrowserSideNavigationHistogramTest) { | |
1870 const GURL kUrl0("http://www.google.com/"); | |
1871 const GURL kUrl1("http://www.chromium.org/"); | |
1872 base::HistogramTester histo_tester; | |
1873 | |
1874 // Performs a "normal" non-PlzNavigate navigation | |
1875 contents()->NavigateAndCommit(kUrl0); | |
1876 histo_tester.ExpectTotalCount("Navigation.TimeToNavigationFinished", 1); | |
1877 | |
1878 // Performs a PlzNavigate navigation | |
1879 EnableBrowserSideNavigation(); | |
1880 contents()->NavigateAndCommit(kUrl1); | |
1881 histo_tester.ExpectTotalCount("Navigation.TimeToNavigationFinished", 2); | |
1882 } | |
1883 | |
1863 } // namespace content | 1884 } // namespace content |
OLD | NEW |