| OLD | NEW |
| 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/tabs/tab_strip_model.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 "net/test/spawned_test_server.h" | 11 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 12 | 12 |
| 13 class LoadtimesExtensionBindingsTest : public InProcessBrowserTest { | 13 class LoadtimesExtensionBindingsTest : public InProcessBrowserTest { |
| 14 public: | 14 public: |
| 15 LoadtimesExtensionBindingsTest() {} | 15 LoadtimesExtensionBindingsTest() {} |
| 16 | 16 |
| 17 void CompareBeforeAndAfter() { | 17 void CompareBeforeAndAfter() { |
| 18 // TODO(simonjam): There's a race on whether or not first paint is populated | 18 // TODO(simonjam): There's a race on whether or not first paint is populated |
| 19 // before we read them. We ought to test that too. Until the race is fixed, | 19 // before we read them. We ought to test that too. Until the race is fixed, |
| 20 // zero it out so the test is stable. | 20 // zero it out so the test is stable. |
| 21 content::WebContents* contents = | 21 content::WebContents* contents = |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 ui_test_utils::NavigateToURL(browser(), plain_url); | 67 ui_test_utils::NavigateToURL(browser(), plain_url); |
| 68 content::WebContents* contents = | 68 content::WebContents* contents = |
| 69 browser()->tab_strip_model()->GetActiveWebContents(); | 69 browser()->tab_strip_model()->GetActiveWebContents(); |
| 70 ASSERT_TRUE(content::ExecuteScript( | 70 ASSERT_TRUE(content::ExecuteScript( |
| 71 contents, "window.before = window.chrome.loadTimes()")); | 71 contents, "window.before = window.chrome.loadTimes()")); |
| 72 ui_test_utils::NavigateToURL(browser(), hash_url); | 72 ui_test_utils::NavigateToURL(browser(), hash_url); |
| 73 ASSERT_TRUE(content::ExecuteScript( | 73 ASSERT_TRUE(content::ExecuteScript( |
| 74 contents, "window.after = window.chrome.loadTimes()")); | 74 contents, "window.after = window.chrome.loadTimes()")); |
| 75 CompareBeforeAndAfter(); | 75 CompareBeforeAndAfter(); |
| 76 } | 76 } |
| OLD | NEW |