| 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 <utility> |
| 6 |
| 5 #include "base/base_switches.h" | 7 #include "base/base_switches.h" |
| 6 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 7 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/strings/stringprintf.h" | 11 #include "base/strings/stringprintf.h" |
| 10 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 11 #include "chrome/browser/ui/browser.h" | 13 #include "chrome/browser/ui/browser.h" |
| 12 #include "chrome/browser/ui/browser_commands.h" | 14 #include "chrome/browser/ui/browser_commands.h" |
| 13 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 14 #include "chrome/common/url_constants.h" | 16 #include "chrome/common/url_constants.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 if (request.relative_url != path_) | 57 if (request.relative_url != path_) |
| 56 return scoped_ptr<net::test_server::HttpResponse>(); | 58 return scoped_ptr<net::test_server::HttpResponse>(); |
| 57 | 59 |
| 58 request_count_++; | 60 request_count_++; |
| 59 scoped_ptr<net::test_server::BasicHttpResponse> response( | 61 scoped_ptr<net::test_server::BasicHttpResponse> response( |
| 60 new net::test_server::BasicHttpResponse); | 62 new net::test_server::BasicHttpResponse); |
| 61 response->set_content(base::StringPrintf("<title>%d</title>", | 63 response->set_content(base::StringPrintf("<title>%d</title>", |
| 62 request_count_)); | 64 request_count_)); |
| 63 response->set_content_type("text/html"); | 65 response->set_content_type("text/html"); |
| 64 response->AddCustomHeader("Cache-Control", "max-age=99999"); | 66 response->AddCustomHeader("Cache-Control", "max-age=99999"); |
| 65 return response.Pass(); | 67 return std::move(response); |
| 66 } | 68 } |
| 67 private: | 69 private: |
| 68 std::string path_; | 70 std::string path_; |
| 69 int request_count_; | 71 int request_count_; |
| 70 | 72 |
| 71 DISALLOW_COPY_AND_ASSIGN(CacheMaxAgeHandler); | 73 DISALLOW_COPY_AND_ASSIGN(CacheMaxAgeHandler); |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 class CrashRecoveryBrowserTest : public InProcessBrowserTest { | 76 class CrashRecoveryBrowserTest : public InProcessBrowserTest { |
| 75 protected: | 77 protected: |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 172 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 171 | 173 |
| 172 chrome::Reload(browser(), CURRENT_TAB); | 174 chrome::Reload(browser(), CURRENT_TAB); |
| 173 content::WaitForLoadStop(GetActiveWebContents()); | 175 content::WaitForLoadStop(GetActiveWebContents()); |
| 174 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); | 176 ASSERT_EQ(url, GetActiveWebContents()->GetVisibleURL()); |
| 175 } | 177 } |
| 176 | 178 |
| 177 } // namespace | 179 } // namespace |
| 178 | 180 |
| 179 #endif | 181 #endif |
| OLD | NEW |