summaryrefslogtreecommitdiffstats
path: root/chrome_frame
diff options
context:
space:
mode:
authorrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 15:08:31 +0000
committerrobertshield@chromium.org <robertshield@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-25 15:08:31 +0000
commitd44913f15e2b75285f9fda8784e638d015ff5baa (patch)
tree00c4bc7fbe42fb3249193818b134881281fdddc2 /chrome_frame
parentfcc5ab7f60a292e2969f2db9cbeab66a907e6eac (diff)
downloadchromium_src-d44913f15e2b75285f9fda8784e638d015ff5baa.zip
chromium_src-d44913f15e2b75285f9fda8784e638d015ff5baa.tar.gz
chromium_src-d44913f15e2b75285f9fda8784e638d015ff5baa.tar.bz2
A couple more improvements to chrome_frame_tests.exe:
Add a useful return value to LaunchIEAndNavigate, indicating which step failed. Also fix a crash in the HungCOMCallDetector if LaunchIEAndNavigate() fails. BUG=NONE TEST=NONE Review URL: https://chromiumcodereview.appspot.com/9160029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@119070 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame')
-rw-r--r--chrome_frame/test/ie_event_sink.cc21
-rw-r--r--chrome_frame/test/mock_ie_event_sink_test.cc12
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();