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

Side by Side Diff: chrome/browser/net/load_timing_observer_browsertest.cc

Issue 12066003: Remove TabStripModel wrapper use. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: gtk Created 7 years, 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/mouseleave_browsertest.cc ('k') | chrome/browser/net/proxy_browsertest.cc » ('j') | 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 "chrome/browser/ui/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 #include "chrome/browser/ui/browser_tabstrip.h" 6 #include "chrome/browser/ui/tabs/tab_strip_model.h"
7 #include "chrome/test/base/in_process_browser_test.h" 7 #include "chrome/test/base/in_process_browser_test.h"
8 #include "chrome/test/base/ui_test_utils.h" 8 #include "chrome/test/base/ui_test_utils.h"
9 #include "content/public/browser/web_contents.h" 9 #include "content/public/browser/web_contents.h"
10 #include "content/public/test/browser_test_utils.h" 10 #include "content/public/test/browser_test_utils.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 #include "net/test/test_server.h" 12 #include "net/test/test_server.h"
13 13
14 class LoadTimingObserverTest : public InProcessBrowserTest { 14 class LoadTimingObserverTest : public InProcessBrowserTest {
15 public: 15 public:
16 LoadTimingObserverTest() {} 16 LoadTimingObserverTest() {}
17 }; 17 };
18 18
19 // http://crbug.com/102030 19 // http://crbug.com/102030
20 IN_PROC_BROWSER_TEST_F(LoadTimingObserverTest, DISABLED_CacheHitAfterRedirect) { 20 IN_PROC_BROWSER_TEST_F(LoadTimingObserverTest, DISABLED_CacheHitAfterRedirect) {
21 ASSERT_TRUE(test_server()->Start()); 21 ASSERT_TRUE(test_server()->Start());
22 GURL cached_page = test_server()->GetURL("cachetime"); 22 GURL cached_page = test_server()->GetURL("cachetime");
23 std::string redirect = "server-redirect?" + cached_page.spec(); 23 std::string redirect = "server-redirect?" + cached_page.spec();
24 ui_test_utils::NavigateToURL(browser(), cached_page); 24 ui_test_utils::NavigateToURL(browser(), cached_page);
25 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(redirect)); 25 ui_test_utils::NavigateToURL(browser(), test_server()->GetURL(redirect));
26 26
27 int response_start = 0; 27 int response_start = 0;
28 int response_end = 0; 28 int response_end = 0;
29 content::WebContents* contents = chrome::GetActiveWebContents(browser()); 29 content::WebContents* contents =
30 browser()->tab_strip_model()->GetActiveWebContents();
30 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 31 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
31 contents, 32 contents,
32 "window.domAutomationController.send(" 33 "window.domAutomationController.send("
33 " window.performance.timing.responseStart - " 34 " window.performance.timing.responseStart - "
34 " window.performance.timing.navigationStart)", 35 " window.performance.timing.navigationStart)",
35 &response_start)); 36 &response_start));
36 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 37 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
37 contents, 38 contents,
38 "window.domAutomationController.send(" 39 "window.domAutomationController.send("
39 " window.performance.timing.responseEnd - " 40 " window.performance.timing.responseEnd - "
40 " window.performance.timing.navigationStart)", 41 " window.performance.timing.navigationStart)",
41 &response_end)); 42 &response_end));
42 EXPECT_LE(response_start, response_end); 43 EXPECT_LE(response_start, response_end);
43 } 44 }
OLDNEW
« no previous file with comments | « chrome/browser/mouseleave_browsertest.cc ('k') | chrome/browser/net/proxy_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698