blob: 4029cec613e800a4a64d528b87aa7f495fc42248 [file] [log] [blame]
[email protected]97f9a7952014-03-14 11:50:331// Copyright 2014 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
6#define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
7
8#include <deque>
9#include <set>
10#include <string>
11
12#include "base/memory/scoped_ptr.h"
13#include "base/memory/weak_ptr.h"
14#include "content/shell/renderer/test_runner/WebTask.h"
15#include "content/shell/renderer/test_runner/WebTestRunner.h"
16#include "v8/include/v8.h"
17
18namespace blink {
19class WebFrame;
20class WebNotificationPresenter;
21class WebPermissionClient;
22class WebString;
23class WebView;
24}
25
26namespace gin {
27class ArrayBufferView;
28class Arguments;
29}
30
31namespace WebTestRunner {
32class TestInterfaces;
33class WebPermissions;
34class WebTestDelegate;
35class WebTestProxyBase;
36}
37
38namespace content {
39
[email protected]97d3fe82014-04-05 02:40:0040class InvokeCallbackTask;
[email protected]97f9a7952014-03-14 11:50:3341class NotificationPresenter;
42class TestPageOverlay;
43
44class TestRunner : public ::WebTestRunner::WebTestRunner,
45 public base::SupportsWeakPtr<TestRunner> {
46 public:
47 explicit TestRunner(::WebTestRunner::TestInterfaces*);
48 virtual ~TestRunner();
49
50 void Install(blink::WebFrame* frame);
51
52 void SetDelegate(::WebTestRunner::WebTestDelegate*);
53 void SetWebView(blink::WebView*, ::WebTestRunner::WebTestProxyBase*);
54
55 void Reset();
56
57 ::WebTestRunner::WebTaskList* taskList() { return &task_list_; }
58
59 void SetTestIsRunning(bool);
60 bool TestIsRunning() const { return test_is_running_; }
61
62 bool UseMockTheme() const { return use_mock_theme_; }
63
[email protected]97d3fe82014-04-05 02:40:0064 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback);
65
[email protected]97f9a7952014-03-14 11:50:3366 // WebTestRunner implementation.
67 virtual bool shouldGeneratePixelResults() OVERRIDE;
68 virtual bool shouldDumpAsAudio() const OVERRIDE;
69 virtual void getAudioData(std::vector<unsigned char>* bufferView) const
70 OVERRIDE;
71 virtual bool shouldDumpBackForwardList() const OVERRIDE;
72 virtual blink::WebPermissionClient* webPermissions() const OVERRIDE;
73
74 // Methods used by WebTestProxyBase.
75 bool shouldDumpSelectionRect() const;
76 bool testRepaint() const;
77 bool sweepHorizontally() const;
78 bool isPrinting() const;
79 bool shouldDumpAsText();
80 bool shouldDumpAsTextWithPixelResults();
81 bool shouldDumpAsMarkup();
82 bool shouldDumpChildFrameScrollPositions() const;
83 bool shouldDumpChildFramesAsText() const;
84 void showDevTools(const std::string& settings);
85 void clearDevToolsLocalStorage();
86 void setShouldDumpAsText(bool);
87 void setShouldDumpAsMarkup(bool);
88 void setShouldGeneratePixelResults(bool);
89 void setShouldDumpFrameLoadCallbacks(bool);
90 void setShouldDumpPingLoaderCallbacks(bool);
91 void setShouldEnableViewSource(bool);
92 bool shouldDumpEditingCallbacks() const;
93 bool shouldDumpFrameLoadCallbacks() const;
94 bool shouldDumpPingLoaderCallbacks() const;
95 bool shouldDumpUserGestureInFrameLoadCallbacks() const;
96 bool shouldDumpTitleChanges() const;
97 bool shouldDumpIconChanges() const;
98 bool shouldDumpCreateView() const;
99 bool canOpenWindows() const;
100 bool shouldDumpResourceLoadCallbacks() const;
101 bool shouldDumpResourceRequestCallbacks() const;
102 bool shouldDumpResourceResponseMIMETypes() const;
103 bool shouldDumpStatusCallbacks() const;
104 bool shouldDumpProgressFinishedCallback() const;
105 bool shouldDumpSpellCheckCallbacks() const;
106 bool shouldStayOnPageAfterHandlingBeforeUnload() const;
107 const std::set<std::string>* httpHeadersToClear() const;
108 void setTopLoadingFrame(blink::WebFrame*, bool);
109 blink::WebFrame* topLoadingFrame() const;
110 void policyDelegateDone();
111 bool policyDelegateEnabled() const;
112 bool policyDelegateIsPermissive() const;
113 bool policyDelegateShouldNotifyDone() const;
114 bool shouldInterceptPostMessage() const;
115 bool shouldDumpResourcePriorities() const;
116 blink::WebNotificationPresenter* notification_presenter() const;
117 bool RequestPointerLock();
118 void RequestPointerUnlock();
119 bool isPointerLocked();
120 void setToolTipText(const blink::WebString&);
121
122 bool midiAccessorResult();
123
124 // A single item in the work queue.
125 class WorkItem {
126 public:
127 virtual ~WorkItem() {}
128
129 // Returns true if this started a load.
130 virtual bool Run(::WebTestRunner::WebTestDelegate*, blink::WebView*) = 0;
131 };
132
133 private:
134 friend class InvokeCallbackTask;
135 friend class TestRunnerBindings;
136 friend class WorkQueue;
137
138 // Helper class for managing events queued by methods like queueLoad or
139 // queueScript.
140 class WorkQueue {
141 public:
142 explicit WorkQueue(TestRunner* controller);
143 virtual ~WorkQueue();
144 void ProcessWorkSoon();
145
146 // Reset the state of the class between tests.
147 void Reset();
148
149 void AddWork(WorkItem*);
150
151 void set_frozen(bool frozen) { frozen_ = frozen; }
152 bool is_empty() { return queue_.empty(); }
153 ::WebTestRunner::WebTaskList* taskList() { return &task_list_; }
154
155 private:
156 void ProcessWork();
157
158 class WorkQueueTask : public ::WebTestRunner::WebMethodTask<WorkQueue> {
159 public:
160 WorkQueueTask(WorkQueue* object) :
161 ::WebTestRunner::WebMethodTask<WorkQueue>(object) { }
162
163 virtual void runIfValid() OVERRIDE;
164 };
165
166 ::WebTestRunner::WebTaskList task_list_;
167 std::deque<WorkItem*> queue_;
168 bool frozen_;
169 TestRunner* controller_;
170 };
171
172 ///////////////////////////////////////////////////////////////////////////
173 // Methods dealing with the test logic
174
175 // By default, tests end when page load is complete. These methods are used
176 // to delay the completion of the test until notifyDone is called.
177 void NotifyDone();
178 void WaitUntilDone();
179
180 // Methods for adding actions to the work queue. Used in conjunction with
181 // waitUntilDone/notifyDone above.
182 void QueueBackNavigation(int how_far_back);
183 void QueueForwardNavigation(int how_far_forward);
184 void QueueReload();
185 void QueueLoadingScript(const std::string& script);
186 void QueueNonLoadingScript(const std::string& script);
187 void QueueLoad(const std::string& url, const std::string& target);
188 void QueueLoadHTMLString(gin::Arguments* args);
189
190 // Causes navigation actions just printout the intended navigation instead
191 // of taking you to the page. This is used for cases like mailto, where you
192 // don't actually want to open the mail program.
193 void SetCustomPolicyDelegate(gin::Arguments* args);
194
195 // Delays completion of the test until the policy delegate runs.
196 void WaitForPolicyDelegate();
197
198 // Functions for dealing with windows. By default we block all new windows.
199 int WindowCount();
200 void SetCloseRemainingWindowsWhenComplete(bool close_remaining_windows);
201 void ResetTestHelperControllers();
202
203 ///////////////////////////////////////////////////////////////////////////
204 // Methods implemented entirely in terms of chromium's public WebKit API
205
206 // Method that controls whether pressing Tab key cycles through page elements
207 // or inserts a '\t' char in text area
208 void SetTabKeyCyclesThroughElements(bool tab_key_cycles_through_elements);
209
210 // Executes an internal command (superset of document.execCommand() commands).
211 void ExecCommand(gin::Arguments* args);
212
213 // Checks if an internal command is currently available.
214 bool IsCommandEnabled(const std::string& command);
215
216 bool CallShouldCloseOnWebView();
217 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden,
218 const std::string& scheme);
219 v8::Handle<v8::Value> EvaluateScriptInIsolatedWorldAndReturnValue(
220 int world_id, const std::string& script);
221 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script);
222 void SetIsolatedWorldSecurityOrigin(int world_id,
223 v8::Handle<v8::Value> origin);
224 void SetIsolatedWorldContentSecurityPolicy(int world_id,
225 const std::string& policy);
226
227 // Allows layout tests to manage origins' whitelisting.
228 void AddOriginAccessWhitelistEntry(const std::string& source_origin,
229 const std::string& destination_protocol,
230 const std::string& destination_host,
231 bool allow_destination_subdomains);
232 void RemoveOriginAccessWhitelistEntry(const std::string& source_origin,
233 const std::string& destination_protocol,
234 const std::string& destination_host,
235 bool allow_destination_subdomains);
236
237 // Returns true if the current page box has custom page size style for
238 // printing.
239 bool HasCustomPageSizeStyle(int page_index);
240
241 // Forces the selection colors for testing under Linux.
242 void ForceRedSelectionColors();
243
244 // Adds a style sheet to be injected into new documents.
245 void InjectStyleSheet(const std::string& source_code, bool all_frames);
246
247 bool FindString(const std::string& search_text,
248 const std::vector<std::string>& options_array);
249
250 std::string SelectionAsMarkup();
251
252 // Enables or disables subpixel positioning (i.e. fractional X positions for
253 // glyphs) in text rendering on Linux. Since this method changes global
254 // settings, tests that call it must use their own custom font family for
255 // all text that they render. If not, an already-cached style will be used,
256 // resulting in the changed setting being ignored.
257 void SetTextSubpixelPositioning(bool value);
258
259 // Switch the visibility of the page.
260 void SetPageVisibility(const std::string& new_visibility);
261
262 // Changes the direction of the focused element.
263 void SetTextDirection(const std::string& direction_name);
264
265 // After this function is called, all window-sizing machinery is
266 // short-circuited inside the renderer. This mode is necessary for
267 // some tests that were written before browsers had multi-process architecture
268 // and rely on window resizes to happen synchronously.
269 // The function has "unfortunate" it its name because we must strive to remove
270 // all tests that rely on this... well, unfortunate behavior. See
271 // http://crbug.com/309760 for the plan.
272 void UseUnfortunateSynchronousResizeMode();
273
274 bool EnableAutoResizeMode(int min_width,
275 int min_height,
276 int max_width,
277 int max_height);
278 bool DisableAutoResizeMode(int new_width, int new_height);
279
280 // Device Motion / Device Orientation related functions
281 void SetMockDeviceMotion(bool has_acceleration_x, double acceleration_x,
282 bool has_acceleration_y, double acceleration_y,
283 bool has_acceleration_z, double acceleration_z,
284 bool has_acceleration_including_gravity_x,
285 double acceleration_including_gravity_x,
286 bool has_acceleration_including_gravity_y,
287 double acceleration_including_gravity_y,
288 bool has_acceleration_including_gravity_z,
289 double acceleration_including_gravity_z,
290 bool has_rotation_rate_alpha,
291 double rotation_rate_alpha,
292 bool has_rotation_rate_beta,
293 double rotation_rate_beta,
294 bool has_rotation_rate_gamma,
295 double rotation_rate_gamma,
296 double interval);
297 void SetMockDeviceOrientation(bool has_alpha, double alpha,
298 bool has_beta, double beta,
299 bool has_gamma, double gamma,
300 bool has_absolute, bool absolute);
301
[email protected]e0bc2cb2014-03-20 17:34:24302 void SetMockScreenOrientation(const std::string& orientation);
303
[email protected]97f9a7952014-03-14 11:50:33304 void DidAcquirePointerLock();
305 void DidNotAcquirePointerLock();
306 void DidLosePointerLock();
307 void SetPointerLockWillFailSynchronously();
308 void SetPointerLockWillRespondAsynchronously();
309
310 ///////////////////////////////////////////////////////////////////////////
311 // Methods modifying WebPreferences.
312
313 // Set the WebPreference that controls webkit's popup blocking.
314 void SetPopupBlockingEnabled(bool block_popups);
315
316 void SetJavaScriptCanAccessClipboard(bool can_access);
317 void SetXSSAuditorEnabled(bool enabled);
318 void SetAllowUniversalAccessFromFileURLs(bool allow);
319 void SetAllowFileAccessFromFileURLs(bool allow);
320 void OverridePreference(const std::string key, v8::Handle<v8::Value> value);
321
322 // Enable or disable plugins.
323 void SetPluginsEnabled(bool enabled);
324
325 ///////////////////////////////////////////////////////////////////////////
326 // Methods that modify the state of TestRunner
327
328 // This function sets a flag that tells the test_shell to print a line of
329 // descriptive text for each editing command. It takes no arguments, and
330 // ignores any that may be present.
331 void DumpEditingCallbacks();
332
333 // This function sets a flag that tells the test_shell to dump pages as
334 // plain text, rather than as a text representation of the renderer's state.
335 // The pixel results will not be generated for this test.
336 void DumpAsText();
337
338 // This function sets a flag that tells the test_shell to dump pages as
339 // plain text, rather than as a text representation of the renderer's state.
340 // It will also generate a pixel dump for the test.
341 void DumpAsTextWithPixelResults();
342
343 // This function sets a flag that tells the test_shell to print out the
344 // scroll offsets of the child frames. It ignores all.
345 void DumpChildFrameScrollPositions();
346
347 // This function sets a flag that tells the test_shell to recursively
348 // dump all frames as plain text if the DumpAsText flag is set.
349 // It takes no arguments, and ignores any that may be present.
350 void DumpChildFramesAsText();
351
352 // This function sets a flag that tells the test_shell to print out the
353 // information about icon changes notifications from WebKit.
354 void DumpIconChanges();
355
356 // Deals with Web Audio WAV file data.
357 void SetAudioData(const gin::ArrayBufferView& view);
358
359 // This function sets a flag that tells the test_shell to print a line of
360 // descriptive text for each frame load callback. It takes no arguments, and
361 // ignores any that may be present.
362 void DumpFrameLoadCallbacks();
363
364 // This function sets a flag that tells the test_shell to print a line of
365 // descriptive text for each PingLoader dispatch. It takes no arguments, and
366 // ignores any that may be present.
367 void DumpPingLoaderCallbacks();
368
369 // This function sets a flag that tells the test_shell to print a line of
370 // user gesture status text for some frame load callbacks. It takes no
371 // arguments, and ignores any that may be present.
372 void DumpUserGestureInFrameLoadCallbacks();
373
374 void DumpTitleChanges();
375
376 // This function sets a flag that tells the test_shell to dump all calls to
377 // WebViewClient::createView().
378 // It takes no arguments, and ignores any that may be present.
379 void DumpCreateView();
380
381 void SetCanOpenWindows();
382
383 // This function sets a flag that tells the test_shell to dump a descriptive
384 // line for each resource load callback. It takes no arguments, and ignores
385 // any that may be present.
386 void DumpResourceLoadCallbacks();
387
388 // This function sets a flag that tells the test_shell to print a line of
389 // descriptive text for each element that requested a resource. It takes no
390 // arguments, and ignores any that may be present.
391 void DumpResourceRequestCallbacks();
392
393 // This function sets a flag that tells the test_shell to dump the MIME type
394 // for each resource that was loaded. It takes no arguments, and ignores any
395 // that may be present.
396 void DumpResourceResponseMIMETypes();
397
398 // WebPermissionClient related.
399 void SetImagesAllowed(bool allowed);
400 void SetScriptsAllowed(bool allowed);
401 void SetStorageAllowed(bool allowed);
402 void SetPluginsAllowed(bool allowed);
403 void SetAllowDisplayOfInsecureContent(bool allowed);
404 void SetAllowRunningOfInsecureContent(bool allowed);
405 void DumpPermissionClientCallbacks();
406
407 // This function sets a flag that tells the test_shell to dump all calls
408 // to window.status().
409 // It takes no arguments, and ignores any that may be present.
410 void DumpWindowStatusChanges();
411
412 // This function sets a flag that tells the test_shell to print a line of
413 // descriptive text for the progress finished callback. It takes no
414 // arguments, and ignores any that may be present.
415 void DumpProgressFinishedCallback();
416
417 // This function sets a flag that tells the test_shell to dump all
418 // the lines of descriptive text about spellcheck execution.
419 void DumpSpellCheckCallbacks();
420
421 // This function sets a flag that tells the test_shell to print out a text
422 // representation of the back/forward list. It ignores all arguments.
423 void DumpBackForwardList();
424
425 void DumpSelectionRect();
426 void TestRepaint();
427 void RepaintSweepHorizontally();
428
429 // Causes layout to happen as if targetted to printed pages.
430 void SetPrinting();
431
432 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value);
433
434 // Causes WillSendRequest to clear certain headers.
435 void SetWillSendRequestClearHeader(const std::string& header);
436
437 // This function sets a flag that tells the test_shell to dump a descriptive
438 // line for each resource load's priority and any time that priority
439 // changes. It takes no arguments, and ignores any that may be present.
440 void DumpResourceRequestPriorities();
441
442 // Sets a flag to enable the mock theme.
443 void SetUseMockTheme(bool use);
444
445 ///////////////////////////////////////////////////////////////////////////
446 // Methods interacting with the WebTestProxy
447
448 ///////////////////////////////////////////////////////////////////////////
449 // Methods forwarding to the WebTestDelegate
450
451 // Shows DevTools window.
452 void ShowWebInspector(const std::string& str);
453 void CloseWebInspector();
454
455 // Inspect chooser state
456 bool IsChooserShown();
457
458 // Allows layout tests to exec scripts at WebInspector side.
459 void EvaluateInWebInspector(int call_id, const std::string& script);
460
461 // Clears all databases.
462 void ClearAllDatabases();
463 // Sets the default quota for all origins
464 void SetDatabaseQuota(int quota);
465
466 // Changes the cookie policy from the default to allow all cookies.
467 void SetAlwaysAcceptCookies(bool accept);
468
469 // Gives focus to the window.
470 void SetWindowIsKey(bool value);
471
472 // Converts a URL starting with file:///tmp/ to the local mapping.
473 std::string PathToLocalResource(const std::string& path);
474
475 // Used to set the device scale factor.
476 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback);
477
478 // Calls setlocale(LC_ALL, ...) for a specified locale.
479 // Resets between tests.
480 void SetPOSIXLocale(const std::string& locale);
481
482 // MIDI function to control permission handling.
483 void SetMIDIAccessorResult(bool result);
[email protected]661ebb32014-03-26 12:51:03484 void SetMIDISysexPermission(bool value);
[email protected]97f9a7952014-03-14 11:50:33485
486 // Grants permission for desktop notifications to an origin
487 void GrantWebNotificationPermission(const std::string& origin,
488 bool permission_granted);
489 // Simulates a click on a desktop notification.
490 bool SimulateWebNotificationClick(const std::string& value);
491
492 // Speech input related functions.
493 void AddMockSpeechInputResult(const std::string& result,
494 double confidence,
495 const std::string& language);
496 void SetMockSpeechInputDumpRect(bool value);
497 void AddMockSpeechRecognitionResult(const std::string& transcript,
498 double confidence);
499 void SetMockSpeechRecognitionError(const std::string& error,
500 const std::string& message);
501 bool WasMockSpeechRecognitionAborted();
502
503 // WebPageOverlay related functions. Permits the adding and removing of only
504 // one opaque overlay.
505 void AddWebPageOverlay();
506 void RemoveWebPageOverlay();
507
508 void Display();
[email protected]97d3fe82014-04-05 02:40:00509 void DisplayAsync();
510 void DisplayAsyncThen(v8::Handle<v8::Function> callback);
[email protected]97f9a7952014-03-14 11:50:33511
512 ///////////////////////////////////////////////////////////////////////////
513 // Internal helpers
514 void CheckResponseMimeType();
515 void CompleteNotifyDone();
516
517 void DidAcquirePointerLockInternal();
518 void DidNotAcquirePointerLockInternal();
519 void DidLosePointerLockInternal();
520
521 // In the Mac code, this is called to trigger the end of a test after the
522 // page has finished loading. From here, we can generate the dump for the
523 // test.
524 void LocationChangeDone();
525
526 bool test_is_running_;
527
528 // When reset is called, go through and close all but the main test shell
529 // window. By default, set to true but toggled to false using
530 // setCloseRemainingWindowsWhenComplete().
531 bool close_remaining_windows_;
532
533 // If true, don't dump output until notifyDone is called.
534 bool wait_until_done_;
535
536 // Causes navigation actions just printout the intended navigation instead
537 // of taking you to the page. This is used for cases like mailto, where you
538 // don't actually want to open the mail program.
539 bool policy_delegate_enabled_;
540
541 // Toggles the behavior of the policy delegate. If true, then navigations
542 // will be allowed. Otherwise, they will be ignored (dropped).
543 bool policy_delegate_is_permissive_;
544
545 // If true, the policy delegate will signal layout test completion.
546 bool policy_delegate_should_notify_done_;
547
548 WorkQueue work_queue_;
549
550 // Used by a number of layout tests in http/tests/security/dataURL.
551 bool global_flag_;
552
553 // Bound variable to return the name of this platform (chromium).
554 std::string platform_name_;
555
556 // Bound variable to store the last tooltip text
557 std::string tooltip_text_;
558
559 // Bound variable to disable notifyDone calls. This is used in GC leak
560 // tests, where existing LayoutTests are loaded within an iframe. The GC
561 // test harness will set this flag to ignore the notifyDone calls from the
562 // target LayoutTest.
563 bool disable_notify_done_;
564
565 // Bound variable counting the number of top URLs visited.
566 int web_history_item_count_;
567
568 // Bound variable to set whether postMessages should be intercepted or not
569 bool intercept_post_message_;
570
571 // If true, the test_shell will write a descriptive line for each editing
572 // command.
573 bool dump_editting_callbacks_;
574
575 // If true, the test_shell will generate pixel results in DumpAsText mode
576 bool generate_pixel_results_;
577
578 // If true, the test_shell will produce a plain text dump rather than a
579 // text representation of the renderer.
580 bool dump_as_text_;
581
582 // If true and if dump_as_text_ is true, the test_shell will recursively
583 // dump all frames as plain text.
584 bool dump_child_frames_as_text_;
585
586 // If true, the test_shell will produce a dump of the DOM rather than a text
587 // representation of the renderer.
588 bool dump_as_markup_;
589
590 // If true, the test_shell will print out the child frame scroll offsets as
591 // well.
592 bool dump_child_frame_scroll_positions_;
593
594 // If true, the test_shell will print out the icon change notifications.
595 bool dump_icon_changes_;
596
597 // If true, the test_shell will output a base64 encoded WAVE file.
598 bool dump_as_audio_;
599
600 // If true, the test_shell will output a descriptive line for each frame
601 // load callback.
602 bool dump_frame_load_callbacks_;
603
604 // If true, the test_shell will output a descriptive line for each
605 // PingLoader dispatched.
606 bool dump_ping_loader_callbacks_;
607
608 // If true, the test_shell will output a line of the user gesture status
609 // text for some frame load callbacks.
610 bool dump_user_gesture_in_frame_load_callbacks_;
611
612 // If true, output a message when the page title is changed.
613 bool dump_title_changes_;
614
615 // If true, output a descriptive line each time WebViewClient::createView
616 // is invoked.
617 bool dump_create_view_;
618
619 // If true, new windows can be opened via javascript or by plugins. By
620 // default, set to false and can be toggled to true using
621 // setCanOpenWindows().
622 bool can_open_windows_;
623
624 // If true, the test_shell will output a descriptive line for each resource
625 // load callback.
626 bool dump_resource_load_callbacks_;
627
628 // If true, the test_shell will output a descriptive line for each resource
629 // request callback.
630 bool dump_resource_request_callbacks_;
631
632 // If true, the test_shell will output the MIME type for each resource that
633 // was loaded.
634 bool dump_resource_reqponse_mime_types_;
635
636 // If true, the test_shell will dump all changes to window.status.
637 bool dump_window_status_changes_;
638
639 // If true, the test_shell will output a descriptive line for the progress
640 // finished callback.
641 bool dump_progress_finished_callback_;
642
643 // If true, the test_shell will output descriptive test for spellcheck
644 // execution.
645 bool dump_spell_check_callbacks_;
646
647 // If true, the test_shell will produce a dump of the back forward list as
648 // well.
649 bool dump_back_forward_list_;
650
651 // If true, the test_shell will draw the bounds of the current selection rect
652 // taking possible transforms of the selection rect into account.
653 bool dump_selection_rect_;
654
655 // If true, pixel dump will be produced as a series of 1px-tall, view-wide
656 // individual paints over the height of the view.
657 bool test_repaint_;
658
659 // If true and test_repaint_ is true as well, pixel dump will be produced as
660 // a series of 1px-wide, view-tall paints across the width of the view.
661 bool sweep_horizontally_;
662
663 // If true, layout is to target printed pages.
664 bool is_printing_;
665
666 // If false, MockWebMIDIAccessor fails on startSession() for testing.
667 bool midi_accessor_result_;
668
669 bool should_stay_on_page_after_handling_before_unload_;
670
671 bool should_dump_resource_priorities_;
672
673 std::set<std::string> http_headers_to_clear_;
674
675 // WAV audio data is stored here.
676 std::vector<unsigned char> audio_data_;
677
678 // Used for test timeouts.
679 ::WebTestRunner::WebTaskList task_list_;
680
681 ::WebTestRunner::TestInterfaces* test_interfaces_;
682 ::WebTestRunner::WebTestDelegate* delegate_;
683 blink::WebView* web_view_;
684 TestPageOverlay* page_overlay_;
685 ::WebTestRunner::WebTestProxyBase* proxy_;
686
687 // This is non-0 IFF a load is in progress.
688 blink::WebFrame* top_loading_frame_;
689
690 // WebPermissionClient mock object.
691 scoped_ptr< ::WebTestRunner::WebPermissions> web_permissions_;
692
693 scoped_ptr<content::NotificationPresenter> notification_presenter_;
694
695 bool pointer_locked_;
696 enum {
697 PointerLockWillSucceed,
698 PointerLockWillRespondAsync,
699 PointerLockWillFailSync,
700 } pointer_lock_planned_result_;
701 bool use_mock_theme_;
702
703 base::WeakPtrFactory<TestRunner> weak_factory_;
704
705 DISALLOW_COPY_AND_ASSIGN(TestRunner);
706};
707
708} // namespace content
709
710#endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_