Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5239)

Unified Diff: chrome_frame/test/mock_ie_event_sink_actions.h

Issue 3061036: Handle automation server crashes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome_frame/test/ie_event_sink.h ('k') | chrome_frame/test/mock_ie_event_sink_test.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/test/mock_ie_event_sink_actions.h
===================================================================
--- chrome_frame/test/mock_ie_event_sink_actions.h (revision 55540)
+++ chrome_frame/test/mock_ie_event_sink_actions.h (working copy)
@@ -5,6 +5,8 @@
#ifndef CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_
#define CHROME_FRAME_TEST_MOCK_IE_EVENT_SINK_ACTIONS_H_
+#include "base/scoped_bstr_win.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
#include "chrome_frame/test/simulate_input.h"
#include "testing/gmock/include/gmock/gmock.h"
@@ -41,6 +43,28 @@
mock->event_sink()->ExpectRendererWindowHasFocus();
}
+ACTION_P2(ConnectDocPropNotifySink, mock, sink) {
+ ScopedComPtr<IDispatch> document;
+ mock->event_sink()->web_browser2()->get_Document(document.Receive());
+ EXPECT_TRUE(document != NULL); // NOLINT
+ if (document) {
+ sink->Attach(document);
+ }
+}
+
+ACTION_P(DisconnectDocPropNotifySink, sink) {
+ sink->Detach();
+}
+
+ACTION_P3(DelayNavigateToCurrentUrl, mock, loop, delay) {
+ loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(&NavigateToCurrentUrl,
+ mock), delay);
+}
+
+ACTION_P2(ExpectDocumentReadystate, mock, ready_state) {
+ mock->ExpectDocumentReadystate(ready_state);
+}
+
ACTION_P8(DelayExecCommand, mock, loop, delay, cmd_group_guid, cmd_id,
cmd_exec_opt, in_args, out_args) {
loop->PostDelayedTask(FROM_HERE, NewRunnableMethod(mock->event_sink(),
@@ -106,6 +130,13 @@
simulate_input::SendScanCode, c, mod), delay);
}
+
+ACTION(KillChromeFrameProcesses) {
+ KillAllNamedProcessesWithArgument(
+ UTF8ToWide(chrome_frame_test::kChromeImageName),
+ UTF8ToWide(switches::kChromeFrame));
+}
+
// This function selects the address bar via the Alt+d shortcut. This is done
// via a delayed task which executes after the delay which is passed in.
// The subsequent operations like typing in the actual url and then hitting
@@ -138,10 +169,10 @@
int actual_height = 0;
IWebBrowser2* web_browser2 = mock->event_sink()->web_browser2();
- web_browser2->get_Left(reinterpret_cast<long*>(&actual_left));
- web_browser2->get_Top(reinterpret_cast<long*>(&actual_top));
- web_browser2->get_Width(reinterpret_cast<long*>(&actual_width));
- web_browser2->get_Height(reinterpret_cast<long*>(&actual_height));
+ web_browser2->get_Left(reinterpret_cast<long*>(&actual_left)); // NOLINT
+ web_browser2->get_Top(reinterpret_cast<long*>(&actual_top)); // NOLINT
+ web_browser2->get_Width(reinterpret_cast<long*>(&actual_width)); // NOLINT
+ web_browser2->get_Height(reinterpret_cast<long*>(&actual_height)); // NOLINT
EXPECT_EQ(actual_left, left);
EXPECT_EQ(actual_top, top);
« no previous file with comments | « chrome_frame/test/ie_event_sink.h ('k') | chrome_frame/test/mock_ie_event_sink_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698