diff options
author | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 03:09:25 +0000 |
---|---|---|
committer | ananta@chromium.org <ananta@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-24 03:09:25 +0000 |
commit | 59dfeaa1cd4c033be4ce3b28d575d5a1df4712b7 (patch) | |
tree | 816dab53900480387495dffe8f63c9270952f720 /chrome_frame | |
parent | e8768152bbe73727a1fa67698b527b8676d09fcd (diff) | |
download | chromium_src-59dfeaa1cd4c033be4ce3b28d575d5a1df4712b7.zip chromium_src-59dfeaa1cd4c033be4ce3b28d575d5a1df4712b7.tar.gz chromium_src-59dfeaa1cd4c033be4ce3b28d575d5a1df4712b7.tar.bz2 |
More chrome frame test crash fixes. At times we fail to create the HTTP server and end up crashing while
dereferencing a NULL server pointer. Added expectations and checks to handle this gracefully.
Bug=41980
TBR=amit
Review URL: http://codereview.chromium.org/1706011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45526 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r-- | chrome_frame/test/test_with_web_server.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/chrome_frame/test/test_with_web_server.cc b/chrome_frame/test/test_with_web_server.cc index 1687f5e..218fc97 100644 --- a/chrome_frame/test/test_with_web_server.cc +++ b/chrome_frame/test/test_with_web_server.cc @@ -56,8 +56,11 @@ void ChromeFrameTestWithWebServer::SetUp() { .Append(FILE_PATH_LITERAL("data")); server_.SetUp(); - results_dir_ = server_.GetDataDir(); - file_util::AppendToPath(&results_dir_, L"dump"); + EXPECT_TRUE(server_.server() != NULL); + if (server_.server()) { + results_dir_ = server_.GetDataDir(); + file_util::AppendToPath(&results_dir_, L"dump"); + } } void ChromeFrameTestWithWebServer::TearDown() { @@ -68,6 +71,7 @@ void ChromeFrameTestWithWebServer::TearDown() { bool ChromeFrameTestWithWebServer::LaunchBrowser(BrowserKind browser, const wchar_t* page) { + EXPECT_TRUE(server_.server() != NULL); std::wstring url = page; if (url.find(L"files/") != std::wstring::npos) url = UTF8ToWide(server_.Resolve(page).spec()); @@ -130,6 +134,7 @@ bool ChromeFrameTestWithWebServer::BringBrowserToTop() { } bool ChromeFrameTestWithWebServer::WaitForTestToComplete(int milliseconds) { + EXPECT_TRUE(server_.server() != NULL); return server_.WaitToFinish(milliseconds); } |