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 <memory> | 5 #include <memory> |
6 #include <utility> | 6 #include <utility> |
7 | 7 |
8 #include "base/bind.h" | 8 #include "base/bind.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 // that there is no cached copy. | 1000 // that there is no cached copy. |
1001 ui_test_utils::NavigateToURLWithPost(browser(), test_url); | 1001 ui_test_utils::NavigateToURLWithPost(browser(), test_url); |
1002 EXPECT_TRUE(ProbeStaleCopyValue(false)); | 1002 EXPECT_TRUE(ProbeStaleCopyValue(false)); |
1003 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); | 1003 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); |
1004 EXPECT_EQ(0, link_doctor_interceptor()->num_requests()); | 1004 EXPECT_EQ(0, link_doctor_interceptor()->num_requests()); |
1005 | 1005 |
1006 // Clear the cache and reload the same URL; confirm the error page is told | 1006 // Clear the cache and reload the same URL; confirm the error page is told |
1007 // that there is no cached copy. | 1007 // that there is no cached copy. |
1008 BrowsingDataRemover* remover = | 1008 BrowsingDataRemover* remover = |
1009 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 1009 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
1010 remover->Remove(BrowsingDataRemover::Unbounded(), | 1010 remover->Remove(base::Time(), base::Time::Max(), |
1011 BrowsingDataRemover::REMOVE_CACHE, | 1011 BrowsingDataRemover::REMOVE_CACHE, |
1012 BrowsingDataHelper::UNPROTECTED_WEB); | 1012 BrowsingDataHelper::UNPROTECTED_WEB); |
1013 ui_test_utils::NavigateToURL(browser(), test_url); | 1013 ui_test_utils::NavigateToURL(browser(), test_url); |
1014 EXPECT_TRUE(ProbeStaleCopyValue(false)); | 1014 EXPECT_TRUE(ProbeStaleCopyValue(false)); |
1015 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); | 1015 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); |
1016 EXPECT_EQ(0, link_doctor_interceptor()->num_requests()); | 1016 EXPECT_EQ(0, link_doctor_interceptor()->num_requests()); |
1017 } | 1017 } |
1018 | 1018 |
1019 // Check that the easter egg is present and initialised and is not disabled. | 1019 // Check that the easter egg is present and initialised and is not disabled. |
1020 IN_PROC_BROWSER_TEST_F(ErrorPageTest, CheckEasterEggIsNotDisabled) { | 1020 IN_PROC_BROWSER_TEST_F(ErrorPageTest, CheckEasterEggIsNotDisabled) { |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 browser()->tab_strip_model()->GetActiveWebContents(), 1); | 1273 browser()->tab_strip_model()->GetActiveWebContents(), 1); |
1274 ASSERT_TRUE(ReloadStaleCopyFromCache()); | 1274 ASSERT_TRUE(ReloadStaleCopyFromCache()); |
1275 same_tab_observer.Wait(); | 1275 same_tab_observer.Wait(); |
1276 EXPECT_EQ(base::ASCIIToUTF16("Nocache Test Page"), | 1276 EXPECT_EQ(base::ASCIIToUTF16("Nocache Test Page"), |
1277 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); | 1277 browser()->tab_strip_model()->GetActiveWebContents()->GetTitle()); |
1278 | 1278 |
1279 // Clear the cache and reload the same URL; confirm the error page is told | 1279 // Clear the cache and reload the same URL; confirm the error page is told |
1280 // that there is no cached copy. | 1280 // that there is no cached copy. |
1281 BrowsingDataRemover* remover = | 1281 BrowsingDataRemover* remover = |
1282 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); | 1282 BrowsingDataRemoverFactory::GetForBrowserContext(browser()->profile()); |
1283 remover->Remove(BrowsingDataRemover::Unbounded(), | 1283 remover->Remove(base::Time(), base::Time::Max(), |
1284 BrowsingDataRemover::REMOVE_CACHE, | 1284 BrowsingDataRemover::REMOVE_CACHE, |
1285 BrowsingDataHelper::UNPROTECTED_WEB); | 1285 BrowsingDataHelper::UNPROTECTED_WEB); |
1286 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( | 1286 ui_test_utils::NavigateToURLBlockUntilNavigationsComplete( |
1287 browser(), test_url, 2); | 1287 browser(), test_url, 2); |
1288 EXPECT_TRUE(ProbeStaleCopyValue(false)); | 1288 EXPECT_TRUE(ProbeStaleCopyValue(false)); |
1289 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); | 1289 EXPECT_FALSE(IsDisplayingText(browser(), GetShowSavedButtonLabel())); |
1290 } | 1290 } |
1291 | 1291 |
1292 class ErrorPageOfflineTest : public ErrorPageTest { | 1292 class ErrorPageOfflineTest : public ErrorPageTest { |
1293 protected: | 1293 protected: |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1529 Http09WeirdPortEnabled) { | 1529 Http09WeirdPortEnabled) { |
1530 const char kHttp09Response[] = "JumboShrimp"; | 1530 const char kHttp09Response[] = "JumboShrimp"; |
1531 ASSERT_TRUE(embedded_test_server()->Start()); | 1531 ASSERT_TRUE(embedded_test_server()->Start()); |
1532 ui_test_utils::NavigateToURL( | 1532 ui_test_utils::NavigateToURL( |
1533 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + | 1533 browser(), embedded_test_server()->GetURL(std::string("/echo-raw?") + |
1534 kHttp09Response)); | 1534 kHttp09Response)); |
1535 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); | 1535 EXPECT_TRUE(IsDisplayingText(browser(), kHttp09Response)); |
1536 } | 1536 } |
1537 | 1537 |
1538 } // namespace | 1538 } // namespace |
OLD | NEW |