| 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 "base/base_switches.h" | 5 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
| 10 #include "chrome/browser/ui/browser_commands.h" | 10 #include "chrome/browser/ui/browser_commands.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 &title_after_crash)); | 101 &title_after_crash)); |
| 102 EXPECT_NE(title_before_crash, title_after_crash); | 102 EXPECT_NE(title_before_crash, title_after_crash); |
| 103 } | 103 } |
| 104 | 104 |
| 105 // Test that reload after a crash forces a cache revalidation. | 105 // Test that reload after a crash forces a cache revalidation. |
| 106 IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, ReloadCacheRevalidate) { | 106 IN_PROC_BROWSER_TEST_F(CrashRecoveryBrowserTest, ReloadCacheRevalidate) { |
| 107 const char kTestPath[] = "/test"; | 107 const char kTestPath[] = "/test"; |
| 108 | 108 |
| 109 // Use the test server so as not to bypass cache behavior. The title of the | 109 // Use the test server so as not to bypass cache behavior. The title of the |
| 110 // active tab should change only when this URL is reloaded. | 110 // active tab should change only when this URL is reloaded. |
| 111 ASSERT_TRUE(embedded_test_server()->InitializeAndWaitUntilReady()); | 111 ASSERT_TRUE(embedded_test_server()->Start()); |
| 112 embedded_test_server()->RegisterRequestHandler( | 112 embedded_test_server()->RegisterRequestHandler( |
| 113 base::Bind(&CacheMaxAgeHandler::HandleRequest, | 113 base::Bind(&CacheMaxAgeHandler::HandleRequest, |
| 114 base::Owned(new CacheMaxAgeHandler(kTestPath)))); | 114 base::Owned(new CacheMaxAgeHandler(kTestPath)))); |
| 115 ui_test_utils::NavigateToURL(browser(), | 115 ui_test_utils::NavigateToURL(browser(), |
| 116 embedded_test_server()->GetURL(kTestPath)); | 116 embedded_test_server()->GetURL(kTestPath)); |
| 117 | 117 |
| 118 base::string16 title_before_crash; | 118 base::string16 title_before_crash; |
| 119 base::string16 title_after_crash; | 119 base::string16 title_after_crash; |
| 120 | 120 |
| 121 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), | 121 ASSERT_TRUE(ui_test_utils::GetCurrentTabTitle(browser(), |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 168 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 169 | 169 |
| 170 chrome::Reload(browser(), CURRENT_TAB); | 170 chrome::Reload(browser(), CURRENT_TAB); |
| 171 content::WaitForLoadStop(GetActiveWebContents()); | 171 content::WaitForLoadStop(GetActiveWebContents()); |
| 172 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 172 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace | 175 } // namespace |
| 176 | 176 |
| 177 #endif | 177 #endif |
| OLD | NEW |