diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 20:46:22 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-12 20:46:22 +0000 |
commit | a6562bd21d839e7df89c7b7e8dee357099eced81 (patch) | |
tree | 3c6d083c9343fdc6585da03c9b949f38dba19efa /chrome_frame/test/test_with_web_server.cc | |
parent | 69a1f58a5d53946b7d2ed7afbd205b6ca05565a4 (diff) | |
download | chromium_src-a6562bd21d839e7df89c7b7e8dee357099eced81.zip chromium_src-a6562bd21d839e7df89c7b7e8dee357099eced81.tar.gz chromium_src-a6562bd21d839e7df89c7b7e8dee357099eced81.tar.bz2 |
An attempt to catch unexpected script errors in html test pages in a more generic way.
TEST=This is meant to help track down flakiness of a few tests.
BUG=none
Review URL: http://codereview.chromium.org/2052006
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47065 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/test/test_with_web_server.cc')
-rw-r--r-- | chrome_frame/test/test_with_web_server.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index 815ad86..ba009c8 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -158,7 +158,7 @@ bool ChromeFrameTestWithWebServer::WaitForOnLoad(int milliseconds) { } bool ChromeFrameTestWithWebServer::ReadResultFile(const std::wstring& file_name, - std::string* data) { + std::string* data) { std::wstring full_path = results_dir_; file_util::AppendToPath(&full_path, file_name); return file_util::ReadFileToString(full_path, data); @@ -171,6 +171,8 @@ bool ChromeFrameTestWithWebServer::CheckResultFile( if (ret) ret = (data == expected_result); + LogScriptErrorResultFile(); + if (!ret) { LOG(ERROR) << "Error text: " << (data.empty() ? "<empty>" : data.c_str()); } @@ -178,6 +180,16 @@ bool ChromeFrameTestWithWebServer::CheckResultFile( return ret; } +void ChromeFrameTestWithWebServer::LogScriptErrorResultFile() { + std::string data; + ReadResultFile(L"tester_helpers", &data); + if (!data.empty()) { + // Data will be set to the URL of the failing page. + LOG(ERROR) << "Script exception: " << data; + } +} + + void ChromeFrameTestWithWebServer::SimpleBrowserTest(BrowserKind browser, const wchar_t* page, const wchar_t* result_file_to_check) { ASSERT_TRUE(LaunchBrowser(browser, page)); |