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

Unified Diff: chrome_frame/test/mock_ie_event_sink_actions.h

Issue 3156026: Add a method for setting the value of an Accessibility object.... (Closed) Base URL: svn://chrome-svn/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/chrome_frame_ui_test_utils.cc ('k') | chrome_frame/test/mock_ie_event_sink_test.cc » ('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 56373)
+++ chrome_frame/test/mock_ie_event_sink_actions.h (working copy)
@@ -7,6 +7,7 @@
#include <windows.h>
+#include "base/basictypes.h"
#include "base/scoped_bstr_win.h"
#include "chrome/common/chrome_switches.h"
#include "chrome_frame/test/chrome_frame_test_utils.h"
@@ -216,6 +217,20 @@
mock->event_sink()->ExpectAddressBarUrl(expected_url);
}
+// Polls to see if the file is saved and closes the browser once it is.
+// This doesn't do any checking of the contents of the file.
+ACTION_P3(CloseWhenFileSaved, mock, file, timeout_ms) {
+ base::Time start = base::Time::Now();
+ while (!file_util::PathExists(file)) {
+ PlatformThread::Sleep(200);
+ if ((base::Time::Now() - start).InMilliseconds() > timeout_ms) {
+ ADD_FAILURE() << "File was not saved within timeout";
+ break;
+ }
+ }
+ mock->event_sink()->CloseWebBrowser();
+}
+
ACTION_P2(OpenContextMenu, loop, delay) {
loop->PostDelayedTask(FROM_HERE, NewRunnableFunction(
simulate_input::SendScanCode, VK_F10, simulate_input::SHIFT), delay);
@@ -226,7 +241,7 @@
simulate_input::NONE);
}
-ACTION(FocusAccObject) {
+ACTION(FocusWindow) {
scoped_refptr<AccObject> object;
if (FindAccObjectInWindow(arg0, AccObjectMatcher(), &object))
object->Focus();
@@ -250,6 +265,12 @@
object->Select();
}
+ACTION_P2(SetAccObjectValue, matcher, value) {
+ scoped_refptr<AccObject> object;
+ if (FindAccObjectInWindow(arg0, matcher, &object))
+ object->SetValue(value);
+}
+
ACTION(OpenContextMenuAsync) {
// Special case this implementation because the top-left of the window is
// much more likely to be empty than the center.
« no previous file with comments | « chrome_frame/test/chrome_frame_ui_test_utils.cc ('k') | chrome_frame/test/mock_ie_event_sink_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698