diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 18:45:11 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-09-29 18:45:11 +0000 |
commit | 022d781a2cc19279a89e3f32ade891ba133e6077 (patch) | |
tree | d96c73e8c237066dc88d3daeed209e1fbcda03ac /chrome/browser/errorpage_uitest.cc | |
parent | 922e38964eba7f23f2f5f5e5ce3b547f2940bdf3 (diff) | |
download | chromium_src-022d781a2cc19279a89e3f32ade891ba133e6077.zip chromium_src-022d781a2cc19279a89e3f32ade891ba133e6077.tar.gz chromium_src-022d781a2cc19279a89e3f32ade891ba133e6077.tar.bz2 |
Disable alternate error pages on frames and iframes. This is
a request from the link doctor team.
Add a UI test that verifies that no link doctor page is loaded.
Review URL: http://codereview.chromium.org/5032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@2684 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/errorpage_uitest.cc')
-rw-r--r-- | chrome/browser/errorpage_uitest.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/chrome/browser/errorpage_uitest.cc b/chrome/browser/errorpage_uitest.cc index 8da9f1d..ec63430 100644 --- a/chrome/browser/errorpage_uitest.cc +++ b/chrome/browser/errorpage_uitest.cc @@ -5,6 +5,7 @@ #include "base/string_util.h" #include "chrome/test/ui/ui_test.h" #include "chrome/browser/automation/url_request_failed_dns_job.h" +#include "net/url_request/url_request_unittest.h" class ErrorPageTest : public UITest { }; @@ -32,3 +33,29 @@ TEST_F(ErrorPageTest, DNSError) { } }; +TEST_F(ErrorPageTest, IFrame404) { + // iframes that have 404 pages should not trigger an alternate error page. + // In this test, the iframe sets the title of the parent page to "SUCCESS" + // when the iframe loads. If the iframe fails to load (because an alternate + // error page loads instead), then the title will remain as "FAIL". + TestServer server(L"chrome/test/data"); + GURL test_url = server.TestServerPage("files/iframe404.html"); + NavigateToURL(test_url); + + // Verify that the url is in the title. Since it's set via Javascript, we + // need to give it a chance to run. + int i; + std::wstring title; + for (i = 0; i < 10; ++i) { + Sleep(kWaitForActionMaxMsec / 10); + title = GetActiveTabTitle(); + if (title == L"SUCCESS") { + // Success, bail out. + break; + } + } + + if (i == 10) { + FAIL() << "iframe 404 didn't load properly"; + } +}; |