diff options
-rw-r--r-- | chrome_frame/test/ie_event_sink.cc | 21 | ||||
-rw-r--r-- | chrome_frame/test/mock_ie_event_sink_test.cc | 12 |
2 files changed, 23 insertions, 10 deletions
diff --git a/chrome_frame/test/ie_event_sink.cc b/chrome_frame/test/ie_event_sink.cc index dde9ebe..bdff4d2 100644 --- a/chrome_frame/test/ie_event_sink.cc +++ b/chrome_frame/test/ie_event_sink.cc @@ -453,15 +453,28 @@ HWND IEEventSink::GetRendererWindowSafe() { return renderer_window; } -HRESULT IEEventSink::LaunchIEAndNavigate( - const std::wstring& navigate_url, IEEventListener* listener) { +HRESULT IEEventSink::LaunchIEAndNavigate(const std::wstring& navigate_url, + IEEventListener* listener) { listener_ = listener; HRESULT hr = LaunchIEAsComServer(web_browser2_.Receive()); if (SUCCEEDED(hr)) { web_browser2_->put_Visible(VARIANT_TRUE); - Attach(web_browser2_); - hr = Navigate(navigate_url); + hr = Attach(web_browser2_); + if (SUCCEEDED(hr)) { + hr = Navigate(navigate_url); + if (FAILED(hr)) { + LOG(ERROR) << "Failed to navigate IE to " << navigate_url << ", hr = 0x" + << std::hex << hr; + } + } else { + LOG(ERROR) << "Failed to attach to web browser event sink for " + << navigate_url << ", hr = 0x" << std::hex << hr; + } + } else { + LOG(ERROR) << "Failed to Launch IE for " << navigate_url << ", hr = 0x" + << std::hex << hr; } + return hr; } diff --git a/chrome_frame/test/mock_ie_event_sink_test.cc b/chrome_frame/test/mock_ie_event_sink_test.cc index 6ce91cb..9d90bf9 100644 --- a/chrome_frame/test/mock_ie_event_sink_test.cc +++ b/chrome_frame/test/mock_ie_event_sink_test.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -207,13 +207,13 @@ void MockIEEventSinkTest::LaunchIENavigateAndLoop(const std::wstring& url, EXPECT_CALL(ie_mock_, OnQuit()) .WillOnce(QUIT_LOOP(loop_)); + HRESULT hr = ie_mock_.event_sink()->LaunchIEAndNavigate(url, &ie_mock_); ASSERT_HRESULT_SUCCEEDED(hr); - if (hr == S_FALSE) - return; - - ASSERT_TRUE(ie_mock_.event_sink()->web_browser2() != NULL); - loop_.RunFor(timeout); + if (hr != S_FALSE) { + ASSERT_TRUE(ie_mock_.event_sink()->web_browser2() != NULL); + loop_.RunFor(timeout); + } IEEventSink::SetAbnormalShutdown(hung_call_detector_->is_hung()); hung_call_detector_->TearDown(); |