1 // 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.
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_
12 #include "base/memory/scoped_ptr.h"
13 #include "base/memory/weak_ptr.h"
14 #include "content/shell/renderer/test_runner/web_task.h"
15 #include "content/shell/renderer/test_runner/web_test_runner.h"
16 #include "v8/include/v8.h"
23 class WebNotificationPresenter;
24 class WebPermissionClient;
31 class ArrayBufferView;
37 class InvokeCallbackTask;
38 class NotificationPresenter;
40 class TestPageOverlay;
42 class WebTestDelegate;
43 class WebTestProxyBase;
45 class TestRunner : public WebTestRunner,
46 public base::SupportsWeakPtr<TestRunner> {
48 explicit TestRunner(TestInterfaces*);
49 virtual ~TestRunner();
51 void Install(blink::WebFrame* frame);
53 void SetDelegate(WebTestDelegate*);
54 void SetWebView(blink::WebView*, WebTestProxyBase*);
58 WebTaskList* mutable_task_list() { return &task_list_; }
60 void SetTestIsRunning(bool);
61 bool TestIsRunning() const { return test_is_running_; }
63 bool UseMockTheme() const { return use_mock_theme_; }
65 void InvokeCallback(scoped_ptr<InvokeCallbackTask> callback);
67 // WebTestRunner implementation.
68 virtual bool ShouldGeneratePixelResults() OVERRIDE;
69 virtual bool ShouldDumpAsAudio() const OVERRIDE;
70 virtual void GetAudioData(
71 std::vector<unsigned char>* buffer_view) const OVERRIDE;
72 virtual bool ShouldDumpBackForwardList() const OVERRIDE;
73 virtual blink::WebPermissionClient* GetWebPermissions() const OVERRIDE;
75 // Methods used by WebTestProxyBase.
76 bool shouldDumpSelectionRect() const;
77 bool isPrinting() const;
78 bool shouldDumpAsText();
79 bool shouldDumpAsTextWithPixelResults();
80 bool shouldDumpAsCustomText() const;
81 std:: string customDumpText() const;
82 bool shouldDumpAsMarkup();
83 bool shouldDumpChildFrameScrollPositions() const;
84 bool shouldDumpChildFramesAsMarkup() const;
85 bool shouldDumpChildFramesAsText() const;
86 void ShowDevTools(const std::string& settings,
87 const std::string& frontend_url);
88 void ClearDevToolsLocalStorage();
89 void setShouldDumpAsText(bool);
90 void setShouldDumpAsMarkup(bool);
91 void setCustomTextOutput(std::string text);
92 void setShouldGeneratePixelResults(bool);
93 void setShouldDumpFrameLoadCallbacks(bool);
94 void setShouldDumpPingLoaderCallbacks(bool);
95 void setShouldEnableViewSource(bool);
96 bool shouldDumpEditingCallbacks() const;
97 bool shouldDumpFrameLoadCallbacks() const;
98 bool shouldDumpPingLoaderCallbacks() const;
99 bool shouldDumpUserGestureInFrameLoadCallbacks() const;
100 bool shouldDumpTitleChanges() const;
101 bool shouldDumpIconChanges() const;
102 bool shouldDumpCreateView() const;
103 bool canOpenWindows() const;
104 bool shouldDumpResourceLoadCallbacks() const;
105 bool shouldDumpResourceRequestCallbacks() const;
106 bool shouldDumpResourceResponseMIMETypes() const;
107 bool shouldDumpStatusCallbacks() const;
108 bool shouldDumpProgressFinishedCallback() const;
109 bool shouldDumpSpellCheckCallbacks() const;
110 bool shouldStayOnPageAfterHandlingBeforeUnload() const;
111 bool shouldWaitUntilExternalURLLoad() const;
112 const std::set<std::string>* httpHeadersToClear() const;
113 void setTopLoadingFrame(blink::WebFrame*, bool);
114 blink::WebFrame* topLoadingFrame() const;
115 void policyDelegateDone();
116 bool policyDelegateEnabled() const;
117 bool policyDelegateIsPermissive() const;
118 bool policyDelegateShouldNotifyDone() const;
119 bool shouldInterceptPostMessage() const;
120 bool shouldDumpResourcePriorities() const;
121 blink::WebNotificationPresenter* notification_presenter() const;
122 bool RequestPointerLock();
123 void RequestPointerUnlock();
124 bool isPointerLocked();
125 void setToolTipText(const blink::WebString&);
127 bool midiAccessorResult();
129 // A single item in the work queue.
132 virtual ~WorkItem() {}
134 // Returns true if this started a load.
135 virtual bool Run(WebTestDelegate*, blink::WebView*) = 0;
139 friend class InvokeCallbackTask;
140 friend class TestRunnerBindings;
141 friend class WorkQueue;
143 // Helper class for managing events queued by methods like queueLoad or
147 explicit WorkQueue(TestRunner* controller);
148 virtual ~WorkQueue();
149 void ProcessWorkSoon();
151 // Reset the state of the class between tests.
154 void AddWork(WorkItem*);
156 void set_frozen(bool frozen) { frozen_ = frozen; }
157 bool is_empty() { return queue_.empty(); }
158 WebTaskList* mutable_task_list() { return &task_list_; }
163 class WorkQueueTask : public WebMethodTask<WorkQueue> {
165 WorkQueueTask(WorkQueue* object) : WebMethodTask<WorkQueue>(object) {}
167 virtual void RunIfValid() OVERRIDE;
170 WebTaskList task_list_;
171 std::deque<WorkItem*> queue_;
173 TestRunner* controller_;
176 ///////////////////////////////////////////////////////////////////////////
177 // Methods dealing with the test logic
179 // By default, tests end when page load is complete. These methods are used
180 // to delay the completion of the test until notifyDone is called.
182 void WaitUntilDone();
184 // Methods for adding actions to the work queue. Used in conjunction with
185 // waitUntilDone/notifyDone above.
186 void QueueBackNavigation(int how_far_back);
187 void QueueForwardNavigation(int how_far_forward);
189 void QueueLoadingScript(const std::string& script);
190 void QueueNonLoadingScript(const std::string& script);
191 void QueueLoad(const std::string& url, const std::string& target);
192 void QueueLoadHTMLString(gin::Arguments* args);
194 // Causes navigation actions just printout the intended navigation instead
195 // of taking you to the page. This is used for cases like mailto, where you
196 // don't actually want to open the mail program.
197 void SetCustomPolicyDelegate(gin::Arguments* args);
199 // Delays completion of the test until the policy delegate runs.
200 void WaitForPolicyDelegate();
202 // Functions for dealing with windows. By default we block all new windows.
204 void SetCloseRemainingWindowsWhenComplete(bool close_remaining_windows);
205 void ResetTestHelperControllers();
207 ///////////////////////////////////////////////////////////////////////////
208 // Methods implemented entirely in terms of chromium's public WebKit API
210 // Method that controls whether pressing Tab key cycles through page elements
211 // or inserts a '\t' char in text area
212 void SetTabKeyCyclesThroughElements(bool tab_key_cycles_through_elements);
214 // Executes an internal command (superset of document.execCommand() commands).
215 void ExecCommand(gin::Arguments* args);
217 // Checks if an internal command is currently available.
218 bool IsCommandEnabled(const std::string& command);
220 bool CallShouldCloseOnWebView();
221 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden,
222 const std::string& scheme);
223 v8::Handle<v8::Value> EvaluateScriptInIsolatedWorldAndReturnValue(
224 int world_id, const std::string& script);
225 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script);
226 void SetIsolatedWorldSecurityOrigin(int world_id,
227 v8::Handle<v8::Value> origin);
228 void SetIsolatedWorldContentSecurityPolicy(int world_id,
229 const std::string& policy);
231 // Allows layout tests to manage origins' whitelisting.
232 void AddOriginAccessWhitelistEntry(const std::string& source_origin,
233 const std::string& destination_protocol,
234 const std::string& destination_host,
235 bool allow_destination_subdomains);
236 void RemoveOriginAccessWhitelistEntry(const std::string& source_origin,
237 const std::string& destination_protocol,
238 const std::string& destination_host,
239 bool allow_destination_subdomains);
241 // Returns true if the current page box has custom page size style for
243 bool HasCustomPageSizeStyle(int page_index);
245 // Forces the selection colors for testing under Linux.
246 void ForceRedSelectionColors();
248 // Adds a style sheet to be injected into new documents.
249 void InjectStyleSheet(const std::string& source_code, bool all_frames);
251 bool FindString(const std::string& search_text,
252 const std::vector<std::string>& options_array);
254 std::string SelectionAsMarkup();
256 // Enables or disables subpixel positioning (i.e. fractional X positions for
257 // glyphs) in text rendering on Linux. Since this method changes global
258 // settings, tests that call it must use their own custom font family for
259 // all text that they render. If not, an already-cached style will be used,
260 // resulting in the changed setting being ignored.
261 void SetTextSubpixelPositioning(bool value);
263 // Switch the visibility of the page.
264 void SetPageVisibility(const std::string& new_visibility);
266 // Changes the direction of the focused element.
267 void SetTextDirection(const std::string& direction_name);
269 // After this function is called, all window-sizing machinery is
270 // short-circuited inside the renderer. This mode is necessary for
271 // some tests that were written before browsers had multi-process architecture
272 // and rely on window resizes to happen synchronously.
273 // The function has "unfortunate" it its name because we must strive to remove
274 // all tests that rely on this... well, unfortunate behavior. See
275 // http://crbug.com/309760 for the plan.
276 void UseUnfortunateSynchronousResizeMode();
278 bool EnableAutoResizeMode(int min_width,
282 bool DisableAutoResizeMode(int new_width, int new_height);
284 void SetMockDeviceLight(double value);
285 void ResetDeviceLight();
286 // Device Motion / Device Orientation related functions
287 void SetMockDeviceMotion(bool has_acceleration_x, double acceleration_x,
288 bool has_acceleration_y, double acceleration_y,
289 bool has_acceleration_z, double acceleration_z,
290 bool has_acceleration_including_gravity_x,
291 double acceleration_including_gravity_x,
292 bool has_acceleration_including_gravity_y,
293 double acceleration_including_gravity_y,
294 bool has_acceleration_including_gravity_z,
295 double acceleration_including_gravity_z,
296 bool has_rotation_rate_alpha,
297 double rotation_rate_alpha,
298 bool has_rotation_rate_beta,
299 double rotation_rate_beta,
300 bool has_rotation_rate_gamma,
301 double rotation_rate_gamma,
303 void SetMockDeviceOrientation(bool has_alpha, double alpha,
304 bool has_beta, double beta,
305 bool has_gamma, double gamma,
306 bool has_absolute, bool absolute);
308 void SetMockScreenOrientation(const std::string& orientation);
310 void DidChangeBatteryStatus(bool charging,
312 double dischargingTime,
314 void ResetBatteryStatus();
316 void DidAcquirePointerLock();
317 void DidNotAcquirePointerLock();
318 void DidLosePointerLock();
319 void SetPointerLockWillFailSynchronously();
320 void SetPointerLockWillRespondAsynchronously();
322 ///////////////////////////////////////////////////////////////////////////
323 // Methods modifying WebPreferences.
325 // Set the WebPreference that controls webkit's popup blocking.
326 void SetPopupBlockingEnabled(bool block_popups);
328 void SetJavaScriptCanAccessClipboard(bool can_access);
329 void SetXSSAuditorEnabled(bool enabled);
330 void SetAllowUniversalAccessFromFileURLs(bool allow);
331 void SetAllowFileAccessFromFileURLs(bool allow);
332 void OverridePreference(const std::string key, v8::Handle<v8::Value> value);
334 // Modify accept_languages in RendererPreferences.
335 void SetAcceptLanguages(const std::string& accept_languages);
337 // Enable or disable plugins.
338 void SetPluginsEnabled(bool enabled);
340 ///////////////////////////////////////////////////////////////////////////
341 // Methods that modify the state of TestRunner
343 // This function sets a flag that tells the test_shell to print a line of
344 // descriptive text for each editing command. It takes no arguments, and
345 // ignores any that may be present.
346 void DumpEditingCallbacks();
348 // This function sets a flag that tells the test_shell to dump pages as
349 // plain text, rather than as a text representation of the renderer's state.
350 // The pixel results will not be generated for this test.
353 // This function sets a flag that tells the test_shell to dump pages as
354 // the DOM contents, rather than as a text representation of the renderer's
355 // state. The pixel results will not be generated for this test.
358 // This function sets a flag that tells the test_shell to dump pages as
359 // plain text, rather than as a text representation of the renderer's state.
360 // It will also generate a pixel dump for the test.
361 void DumpAsTextWithPixelResults();
363 // This function sets a flag that tells the test_shell to print out the
364 // scroll offsets of the child frames. It ignores all.
365 void DumpChildFrameScrollPositions();
367 // This function sets a flag that tells the test_shell to recursively
368 // dump all frames as plain text if the DumpAsText flag is set.
369 // It takes no arguments, and ignores any that may be present.
370 void DumpChildFramesAsText();
372 // This function sets a flag that tells the test_shell to recursively
373 // dump all frames as the DOM contents if the DumpAsMarkup flag is set.
374 // It takes no arguments, and ignores any that may be present.
375 void DumpChildFramesAsMarkup();
377 // This function sets a flag that tells the test_shell to print out the
378 // information about icon changes notifications from WebKit.
379 void DumpIconChanges();
381 // Deals with Web Audio WAV file data.
382 void SetAudioData(const gin::ArrayBufferView& view);
384 // This function sets a flag that tells the test_shell to print a line of
385 // descriptive text for each frame load callback. It takes no arguments, and
386 // ignores any that may be present.
387 void DumpFrameLoadCallbacks();
389 // This function sets a flag that tells the test_shell to print a line of
390 // descriptive text for each PingLoader dispatch. It takes no arguments, and
391 // ignores any that may be present.
392 void DumpPingLoaderCallbacks();
394 // This function sets a flag that tells the test_shell to print a line of
395 // user gesture status text for some frame load callbacks. It takes no
396 // arguments, and ignores any that may be present.
397 void DumpUserGestureInFrameLoadCallbacks();
399 void DumpTitleChanges();
401 // This function sets a flag that tells the test_shell to dump all calls to
402 // WebViewClient::createView().
403 // It takes no arguments, and ignores any that may be present.
404 void DumpCreateView();
406 void SetCanOpenWindows();
408 // This function sets a flag that tells the test_shell to dump a descriptive
409 // line for each resource load callback. It takes no arguments, and ignores
410 // any that may be present.
411 void DumpResourceLoadCallbacks();
413 // This function sets a flag that tells the test_shell to print a line of
414 // descriptive text for each element that requested a resource. It takes no
415 // arguments, and ignores any that may be present.
416 void DumpResourceRequestCallbacks();
418 // This function sets a flag that tells the test_shell to dump the MIME type
419 // for each resource that was loaded. It takes no arguments, and ignores any
420 // that may be present.
421 void DumpResourceResponseMIMETypes();
423 // WebPermissionClient related.
424 void SetImagesAllowed(bool allowed);
425 void SetMediaAllowed(bool allowed);
426 void SetScriptsAllowed(bool allowed);
427 void SetStorageAllowed(bool allowed);
428 void SetPluginsAllowed(bool allowed);
429 void SetAllowDisplayOfInsecureContent(bool allowed);
430 void SetAllowRunningOfInsecureContent(bool allowed);
431 void DumpPermissionClientCallbacks();
433 // This function sets a flag that tells the test_shell to dump all calls
434 // to window.status().
435 // It takes no arguments, and ignores any that may be present.
436 void DumpWindowStatusChanges();
438 // This function sets a flag that tells the test_shell to print a line of
439 // descriptive text for the progress finished callback. It takes no
440 // arguments, and ignores any that may be present.
441 void DumpProgressFinishedCallback();
443 // This function sets a flag that tells the test_shell to dump all
444 // the lines of descriptive text about spellcheck execution.
445 void DumpSpellCheckCallbacks();
447 // This function sets a flag that tells the test_shell to print out a text
448 // representation of the back/forward list. It ignores all arguments.
449 void DumpBackForwardList();
451 void DumpSelectionRect();
453 // Causes layout to happen as if targetted to printed pages.
456 // Clears the state from SetPrinting().
457 void ClearPrinting();
459 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value);
461 // Causes WillSendRequest to clear certain headers.
462 void SetWillSendRequestClearHeader(const std::string& header);
464 // This function sets a flag that tells the test_shell to dump a descriptive
465 // line for each resource load's priority and any time that priority
466 // changes. It takes no arguments, and ignores any that may be present.
467 void DumpResourceRequestPriorities();
469 // Sets a flag to enable the mock theme.
470 void SetUseMockTheme(bool use);
472 // Sets a flag that causes the test to be marked as completed when the
473 // WebFrameClient receives a loadURLExternally() call.
474 void WaitUntilExternalURLLoad();
476 ///////////////////////////////////////////////////////////////////////////
477 // Methods interacting with the WebTestProxy
479 ///////////////////////////////////////////////////////////////////////////
480 // Methods forwarding to the WebTestDelegate
482 // Shows DevTools window.
483 void ShowWebInspector(const std::string& str,
484 const std::string& frontend_url);
485 void CloseWebInspector();
487 // Inspect chooser state
488 bool IsChooserShown();
490 // Allows layout tests to exec scripts at WebInspector side.
491 void EvaluateInWebInspector(int call_id, const std::string& script);
493 // Clears all databases.
494 void ClearAllDatabases();
495 // Sets the default quota for all origins
496 void SetDatabaseQuota(int quota);
498 // Changes the cookie policy from the default to allow all cookies.
499 void SetAlwaysAcceptCookies(bool accept);
501 // Gives focus to the window.
502 void SetWindowIsKey(bool value);
504 // Converts a URL starting with file:///tmp/ to the local mapping.
505 std::string PathToLocalResource(const std::string& path);
507 // Used to set the device scale factor.
508 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback);
510 // Change the device color profile while running a layout test.
511 void SetColorProfile(const std::string& name,
512 v8::Handle<v8::Function> callback);
514 // Calls setlocale(LC_ALL, ...) for a specified locale.
515 // Resets between tests.
516 void SetPOSIXLocale(const std::string& locale);
518 // MIDI function to control permission handling.
519 void SetMIDIAccessorResult(bool result);
520 void SetMIDISysexPermission(bool value);
522 // Grants permission for desktop notifications to an origin
523 void GrantWebNotificationPermission(const GURL& origin,
524 bool permission_granted);
526 // Clears all previously granted Web Notification permissions.
527 void ClearWebNotificationPermissions();
529 // Simulates a click on a desktop notification.
530 bool SimulateWebNotificationClick(const std::string& value);
532 // Speech recognition related functions.
533 void AddMockSpeechRecognitionResult(const std::string& transcript,
535 void SetMockSpeechRecognitionError(const std::string& error,
536 const std::string& message);
537 bool WasMockSpeechRecognitionAborted();
539 // Credential Manager mock functions
540 // TODO(mkwst): Support FederatedCredential.
541 void AddMockCredentialManagerResponse(const std::string& id,
542 const std::string& name,
543 const std::string& avatar,
544 const std::string& password);
546 // WebPageOverlay related functions. Permits the adding and removing of only
547 // one opaque overlay.
548 void AddWebPageOverlay();
549 void RemoveWebPageOverlay();
552 void DisplayAsyncThen(v8::Handle<v8::Function> callback);
554 // Similar to DisplayAsyncThen(), but pass parameters of the captured
555 // snapshot (width, height, snapshot) to the callback. The snapshot is in
556 // uint8 RGBA format.
557 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback);
558 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image
559 // located at a particular point in the WebView (if there is such an image),
560 // reads back its pixels, and provides the snapshot to the callback. If there
561 // is no image at that point, calls the callback with (0, 0, empty_snapshot).
562 void CopyImageAtAndCapturePixelsAsyncThen(
563 int x, int y, const v8::Handle<v8::Function> callback);
565 void SetMockPushClientSuccess(const std::string& endpoint,
566 const std::string& registration_id);
567 void SetMockPushClientError(const std::string& message);
569 void GetManifestThen(v8::Handle<v8::Function> callback);
571 ///////////////////////////////////////////////////////////////////////////
574 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task,
575 const blink::WebURLResponse& response,
576 const std::string& data);
577 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task,
578 const SkBitmap& snapshot);
580 void CheckResponseMimeType();
581 void CompleteNotifyDone();
583 void DidAcquirePointerLockInternal();
584 void DidNotAcquirePointerLockInternal();
585 void DidLosePointerLockInternal();
587 // In the Mac code, this is called to trigger the end of a test after the
588 // page has finished loading. From here, we can generate the dump for the
590 void LocationChangeDone();
592 bool test_is_running_;
594 // When reset is called, go through and close all but the main test shell
595 // window. By default, set to true but toggled to false using
596 // setCloseRemainingWindowsWhenComplete().
597 bool close_remaining_windows_;
599 // If true, don't dump output until notifyDone is called.
600 bool wait_until_done_;
602 // If true, ends the test when a URL is loaded externally via
603 // WebFrameClient::loadURLExternally().
604 bool wait_until_external_url_load_;
606 // Causes navigation actions just printout the intended navigation instead
607 // of taking you to the page. This is used for cases like mailto, where you
608 // don't actually want to open the mail program.
609 bool policy_delegate_enabled_;
611 // Toggles the behavior of the policy delegate. If true, then navigations
612 // will be allowed. Otherwise, they will be ignored (dropped).
613 bool policy_delegate_is_permissive_;
615 // If true, the policy delegate will signal layout test completion.
616 bool policy_delegate_should_notify_done_;
618 WorkQueue work_queue_;
620 // Bound variable to return the name of this platform (chromium).
621 std::string platform_name_;
623 // Bound variable to store the last tooltip text
624 std::string tooltip_text_;
626 // Bound variable to disable notifyDone calls. This is used in GC leak
627 // tests, where existing LayoutTests are loaded within an iframe. The GC
628 // test harness will set this flag to ignore the notifyDone calls from the
629 // target LayoutTest.
630 bool disable_notify_done_;
632 // Bound variable counting the number of top URLs visited.
633 int web_history_item_count_;
635 // Bound variable to set whether postMessages should be intercepted or not
636 bool intercept_post_message_;
638 // If true, the test_shell will write a descriptive line for each editing
640 bool dump_editting_callbacks_;
642 // If true, the test_shell will generate pixel results in DumpAsText mode
643 bool generate_pixel_results_;
645 // If true, the test_shell will produce a plain text dump rather than a
646 // text representation of the renderer.
649 // If true and if dump_as_text_ is true, the test_shell will recursively
650 // dump all frames as plain text.
651 bool dump_child_frames_as_text_;
653 // If true, the test_shell will produce a dump of the DOM rather than a text
654 // representation of the renderer.
655 bool dump_as_markup_;
657 // If true and if dump_as_markup_ is true, the test_shell will recursively
658 // produce a dump of the DOM rather than a text representation of the
660 bool dump_child_frames_as_markup_;
662 // If true, the test_shell will print out the child frame scroll offsets as
664 bool dump_child_frame_scroll_positions_;
666 // If true, the test_shell will print out the icon change notifications.
667 bool dump_icon_changes_;
669 // If true, the test_shell will output a base64 encoded WAVE file.
672 // If true, the test_shell will output a descriptive line for each frame
674 bool dump_frame_load_callbacks_;
676 // If true, the test_shell will output a descriptive line for each
677 // PingLoader dispatched.
678 bool dump_ping_loader_callbacks_;
680 // If true, the test_shell will output a line of the user gesture status
681 // text for some frame load callbacks.
682 bool dump_user_gesture_in_frame_load_callbacks_;
684 // If true, output a message when the page title is changed.
685 bool dump_title_changes_;
687 // If true, output a descriptive line each time WebViewClient::createView
689 bool dump_create_view_;
691 // If true, new windows can be opened via javascript or by plugins. By
692 // default, set to false and can be toggled to true using
693 // setCanOpenWindows().
694 bool can_open_windows_;
696 // If true, the test_shell will output a descriptive line for each resource
698 bool dump_resource_load_callbacks_;
700 // If true, the test_shell will output a descriptive line for each resource
702 bool dump_resource_request_callbacks_;
704 // If true, the test_shell will output the MIME type for each resource that
706 bool dump_resource_reqponse_mime_types_;
708 // If true, the test_shell will dump all changes to window.status.
709 bool dump_window_status_changes_;
711 // If true, the test_shell will output a descriptive line for the progress
712 // finished callback.
713 bool dump_progress_finished_callback_;
715 // If true, the test_shell will output descriptive test for spellcheck
717 bool dump_spell_check_callbacks_;
719 // If true, the test_shell will produce a dump of the back forward list as
721 bool dump_back_forward_list_;
723 // If true, the test_shell will draw the bounds of the current selection rect
724 // taking possible transforms of the selection rect into account.
725 bool dump_selection_rect_;
727 // If true, pixel dump will be produced as a series of 1px-tall, view-wide
728 // individual paints over the height of the view.
731 // If true and test_repaint_ is true as well, pixel dump will be produced as
732 // a series of 1px-wide, view-tall paints across the width of the view.
733 bool sweep_horizontally_;
735 // If true, layout is to target printed pages.
738 // If false, MockWebMIDIAccessor fails on startSession() for testing.
739 bool midi_accessor_result_;
741 bool should_stay_on_page_after_handling_before_unload_;
743 bool should_dump_resource_priorities_;
745 bool has_custom_text_output_;
746 std::string custom_text_output_;
748 std::set<std::string> http_headers_to_clear_;
750 // WAV audio data is stored here.
751 std::vector<unsigned char> audio_data_;
753 // Used for test timeouts.
754 WebTaskList task_list_;
756 TestInterfaces* test_interfaces_;
757 WebTestDelegate* delegate_;
758 blink::WebView* web_view_;
759 TestPageOverlay* page_overlay_;
760 WebTestProxyBase* proxy_;
762 // This is non-0 IFF a load is in progress.
763 blink::WebFrame* top_loading_frame_;
765 // WebPermissionClient mock object.
766 scoped_ptr<WebPermissions> web_permissions_;
768 scoped_ptr<NotificationPresenter> notification_presenter_;
770 bool pointer_locked_;
772 PointerLockWillSucceed,
773 PointerLockWillRespondAsync,
774 PointerLockWillFailSync,
775 } pointer_lock_planned_result_;
776 bool use_mock_theme_;
778 base::WeakPtrFactory<TestRunner> weak_factory_;
780 DISALLOW_COPY_AND_ASSIGN(TestRunner);
783 } // namespace content
785 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_