| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
| 9 #include "chrome/browser/ui/browser_commands.h" | 9 #include "chrome/browser/ui/browser_commands.h" |
| 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 10 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 ASSERT_TRUE(test_server_->Start()); | 93 ASSERT_TRUE(test_server_->Start()); |
| 94 EnableDataSaver(true); | 94 EnableDataSaver(true); |
| 95 | 95 |
| 96 expected_save_data_header_ = "on"; | 96 expected_save_data_header_ = "on"; |
| 97 ui_test_utils::NavigateToURL(browser(), | 97 ui_test_utils::NavigateToURL(browser(), |
| 98 test_server_->GetURL("/google/google.html")); | 98 test_server_->GetURL("/google/google.html")); |
| 99 | 99 |
| 100 // Reload the webpage and expect the main and the subresources will get the | 100 // Reload the webpage and expect the main and the subresources will get the |
| 101 // correct save-data header. | 101 // correct save-data header. |
| 102 expected_save_data_header_ = "on"; | 102 expected_save_data_header_ = "on"; |
| 103 chrome::Reload(browser(), CURRENT_TAB); | 103 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 104 content::WaitForLoadStop( | 104 content::WaitForLoadStop( |
| 105 browser()->tab_strip_model()->GetActiveWebContents()); | 105 browser()->tab_strip_model()->GetActiveWebContents()); |
| 106 | 106 |
| 107 // Reload the webpage with data saver disabled, and expect all the resources | 107 // Reload the webpage with data saver disabled, and expect all the resources |
| 108 // will get no save-data header. | 108 // will get no save-data header. |
| 109 EnableDataSaver(false); | 109 EnableDataSaver(false); |
| 110 expected_save_data_header_ = ""; | 110 expected_save_data_header_ = ""; |
| 111 chrome::Reload(browser(), CURRENT_TAB); | 111 chrome::Reload(browser(), WindowOpenDisposition::CURRENT_TAB); |
| 112 content::WaitForLoadStop( | 112 content::WaitForLoadStop( |
| 113 browser()->tab_strip_model()->GetActiveWebContents()); | 113 browser()->tab_strip_model()->GetActiveWebContents()); |
| 114 } | 114 } |
| OLD | NEW |