Don't preload rarely seen large images
[chromium-blink-merge.git] / components / test_runner / test_runner.h
blob5bc0f75616c1bb792d9aa4bfcefdddf736955d09
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 COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_
6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_
8 #include <deque>
9 #include <set>
10 #include <string>
11 #include <vector>
13 #include "base/memory/scoped_ptr.h"
14 #include "base/memory/weak_ptr.h"
15 #include "components/test_runner/test_runner_export.h"
16 #include "components/test_runner/web_task.h"
17 #include "components/test_runner/web_test_runner.h"
18 #include "v8/include/v8.h"
20 class GURL;
21 class SkBitmap;
23 namespace blink {
24 class WebContentSettingsClient;
25 class WebFrame;
26 class WebString;
27 class WebView;
28 class WebURLResponse;
31 namespace gin {
32 class ArrayBufferView;
33 class Arguments;
36 namespace test_runner {
38 class InvokeCallbackTask;
39 class TestInterfaces;
40 class TestPageOverlay;
41 class WebContentSettings;
42 class WebTestDelegate;
43 class WebTestProxyBase;
45 class TestRunner : public WebTestRunner,
46 public base::SupportsWeakPtr<TestRunner> {
47 public:
48 explicit TestRunner(TestInterfaces*);
49 virtual ~TestRunner();
51 void Install(blink::WebFrame* frame);
53 void SetDelegate(WebTestDelegate*);
54 void SetWebView(blink::WebView*, WebTestProxyBase*);
56 void Reset();
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 bool ShouldGeneratePixelResults() override;
69 bool ShouldStayOnPageAfterHandlingBeforeUnload() const override;
70 bool ShouldDumpAsAudio() const override;
71 void GetAudioData(std::vector<unsigned char>* buffer_view) const override;
72 bool ShouldDumpBackForwardList() const override;
73 blink::WebContentSettingsClient* GetWebContentSettings() 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 shouldWaitUntilExternalURLLoad() const;
111 const std::set<std::string>* httpHeadersToClear() const;
112 void setTopLoadingFrame(blink::WebFrame*, bool);
113 blink::WebFrame* topLoadingFrame() const;
114 void policyDelegateDone();
115 bool policyDelegateEnabled() const;
116 bool policyDelegateIsPermissive() const;
117 bool policyDelegateShouldNotifyDone() const;
118 bool shouldInterceptPostMessage() const;
119 bool shouldDumpResourcePriorities() const;
120 bool RequestPointerLock();
121 void RequestPointerUnlock();
122 bool isPointerLocked();
123 void setToolTipText(const blink::WebString&);
124 bool shouldDumpDragImage();
125 bool shouldDumpNavigationPolicy() const;
127 bool midiAccessorResult();
129 // A single item in the work queue.
130 class WorkItem {
131 public:
132 virtual ~WorkItem() {}
134 // Returns true if this started a load.
135 virtual bool Run(WebTestDelegate*, blink::WebView*) = 0;
138 private:
139 friend class InvokeCallbackTask;
140 friend class TestRunnerBindings;
141 friend class WorkQueue;
143 // Helper class for managing events queued by methods like queueLoad or
144 // queueScript.
145 class WorkQueue {
146 public:
147 explicit WorkQueue(TestRunner* controller);
148 virtual ~WorkQueue();
149 void ProcessWorkSoon();
151 // Reset the state of the class between tests.
152 void Reset();
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_; }
160 private:
161 void ProcessWork();
163 class WorkQueueTask : public WebMethodTask<WorkQueue> {
164 public:
165 WorkQueueTask(WorkQueue* object) : WebMethodTask<WorkQueue>(object) {}
167 void RunIfValid() override;
170 WebTaskList task_list_;
171 std::deque<WorkItem*> queue_;
172 bool frozen_;
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.
181 void NotifyDone();
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);
188 void QueueReload();
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.
203 int WindowCount();
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::Local<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::Local<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
242 // printing.
243 bool HasCustomPageSizeStyle(int page_index);
245 // Forces the selection colors for testing under Linux.
246 void ForceRedSelectionColors();
248 // Add |source_code| as an injected stylesheet to the active document of the
249 // window of the current V8 context.
250 void InsertStyleSheet(const std::string& source_code);
252 bool FindString(const std::string& search_text,
253 const std::vector<std::string>& options_array);
255 std::string SelectionAsMarkup();
257 // Enables or disables subpixel positioning (i.e. fractional X positions for
258 // glyphs) in text rendering on Linux. Since this method changes global
259 // settings, tests that call it must use their own custom font family for
260 // all text that they render. If not, an already-cached style will be used,
261 // resulting in the changed setting being ignored.
262 void SetTextSubpixelPositioning(bool value);
264 // Switch the visibility of the page.
265 void SetPageVisibility(const std::string& new_visibility);
267 // Changes the direction of the focused element.
268 void SetTextDirection(const std::string& direction_name);
270 // After this function is called, all window-sizing machinery is
271 // short-circuited inside the renderer. This mode is necessary for
272 // some tests that were written before browsers had multi-process architecture
273 // and rely on window resizes to happen synchronously.
274 // The function has "unfortunate" it its name because we must strive to remove
275 // all tests that rely on this... well, unfortunate behavior. See
276 // http://crbug.com/309760 for the plan.
277 void UseUnfortunateSynchronousResizeMode();
279 bool EnableAutoResizeMode(int min_width,
280 int min_height,
281 int max_width,
282 int max_height);
283 bool DisableAutoResizeMode(int new_width, int new_height);
285 void SetMockDeviceLight(double value);
286 void ResetDeviceLight();
287 // Device Motion / Device Orientation related functions
288 void SetMockDeviceMotion(bool has_acceleration_x, double acceleration_x,
289 bool has_acceleration_y, double acceleration_y,
290 bool has_acceleration_z, double acceleration_z,
291 bool has_acceleration_including_gravity_x,
292 double acceleration_including_gravity_x,
293 bool has_acceleration_including_gravity_y,
294 double acceleration_including_gravity_y,
295 bool has_acceleration_including_gravity_z,
296 double acceleration_including_gravity_z,
297 bool has_rotation_rate_alpha,
298 double rotation_rate_alpha,
299 bool has_rotation_rate_beta,
300 double rotation_rate_beta,
301 bool has_rotation_rate_gamma,
302 double rotation_rate_gamma,
303 double interval);
304 void SetMockDeviceOrientation(bool has_alpha, double alpha,
305 bool has_beta, double beta,
306 bool has_gamma, double gamma,
307 bool has_absolute, bool absolute);
309 void SetMockScreenOrientation(const std::string& orientation);
311 void DidChangeBatteryStatus(bool charging,
312 double chargingTime,
313 double dischargingTime,
314 double level);
315 void ResetBatteryStatus();
317 void DidAcquirePointerLock();
318 void DidNotAcquirePointerLock();
319 void DidLosePointerLock();
320 void SetPointerLockWillFailSynchronously();
321 void SetPointerLockWillRespondAsynchronously();
323 ///////////////////////////////////////////////////////////////////////////
324 // Methods modifying WebPreferences.
326 // Set the WebPreference that controls webkit's popup blocking.
327 void SetPopupBlockingEnabled(bool block_popups);
329 void SetJavaScriptCanAccessClipboard(bool can_access);
330 void SetXSSAuditorEnabled(bool enabled);
331 void SetAllowUniversalAccessFromFileURLs(bool allow);
332 void SetAllowFileAccessFromFileURLs(bool allow);
333 void OverridePreference(const std::string key, v8::Local<v8::Value> value);
335 // Modify accept_languages in RendererPreferences.
336 void SetAcceptLanguages(const std::string& accept_languages);
338 // Enable or disable plugins.
339 void SetPluginsEnabled(bool enabled);
341 ///////////////////////////////////////////////////////////////////////////
342 // Methods that modify the state of TestRunner
344 // This function sets a flag that tells the test_shell to print a line of
345 // descriptive text for each editing command. It takes no arguments, and
346 // ignores any that may be present.
347 void DumpEditingCallbacks();
349 // This function sets a flag that tells the test_shell to dump pages as
350 // plain text, rather than as a text representation of the renderer's state.
351 // The pixel results will not be generated for this test.
352 void DumpAsText();
354 // This function sets a flag that tells the test_shell to dump pages as
355 // the DOM contents, rather than as a text representation of the renderer's
356 // state. The pixel results will not be generated for this test.
357 void DumpAsMarkup();
359 // This function sets a flag that tells the test_shell to dump pages as
360 // plain text, rather than as a text representation of the renderer's state.
361 // It will also generate a pixel dump for the test.
362 void DumpAsTextWithPixelResults();
364 // This function sets a flag that tells the test_shell to print out the
365 // scroll offsets of the child frames. It ignores all.
366 void DumpChildFrameScrollPositions();
368 // This function sets a flag that tells the test_shell to recursively
369 // dump all frames as plain text if the DumpAsText flag is set.
370 // It takes no arguments, and ignores any that may be present.
371 void DumpChildFramesAsText();
373 // This function sets a flag that tells the test_shell to recursively
374 // dump all frames as the DOM contents if the DumpAsMarkup flag is set.
375 // It takes no arguments, and ignores any that may be present.
376 void DumpChildFramesAsMarkup();
378 // This function sets a flag that tells the test_shell to print out the
379 // information about icon changes notifications from WebKit.
380 void DumpIconChanges();
382 // Deals with Web Audio WAV file data.
383 void SetAudioData(const gin::ArrayBufferView& view);
385 // This function sets a flag that tells the test_shell to print a line of
386 // descriptive text for each frame load callback. It takes no arguments, and
387 // ignores any that may be present.
388 void DumpFrameLoadCallbacks();
390 // This function sets a flag that tells the test_shell to print a line of
391 // descriptive text for each PingLoader dispatch. It takes no arguments, and
392 // ignores any that may be present.
393 void DumpPingLoaderCallbacks();
395 // This function sets a flag that tells the test_shell to print a line of
396 // user gesture status text for some frame load callbacks. It takes no
397 // arguments, and ignores any that may be present.
398 void DumpUserGestureInFrameLoadCallbacks();
400 void DumpTitleChanges();
402 // This function sets a flag that tells the test_shell to dump all calls to
403 // WebViewClient::createView().
404 // It takes no arguments, and ignores any that may be present.
405 void DumpCreateView();
407 void SetCanOpenWindows();
409 // This function sets a flag that tells the test_shell to dump a descriptive
410 // line for each resource load callback. It takes no arguments, and ignores
411 // any that may be present.
412 void DumpResourceLoadCallbacks();
414 // This function sets a flag that tells the test_shell to print a line of
415 // descriptive text for each element that requested a resource. It takes no
416 // arguments, and ignores any that may be present.
417 void DumpResourceRequestCallbacks();
419 // This function sets a flag that tells the test_shell to dump the MIME type
420 // for each resource that was loaded. It takes no arguments, and ignores any
421 // that may be present.
422 void DumpResourceResponseMIMETypes();
424 // WebContentSettingsClient related.
425 void SetImagesAllowed(bool allowed);
426 void SetMediaAllowed(bool allowed);
427 void SetScriptsAllowed(bool allowed);
428 void SetStorageAllowed(bool allowed);
429 void SetPluginsAllowed(bool allowed);
430 void SetAllowDisplayOfInsecureContent(bool allowed);
431 void SetAllowRunningOfInsecureContent(bool allowed);
432 void DumpPermissionClientCallbacks();
434 // This function sets a flag that tells the test_shell to dump all calls
435 // to window.status().
436 // It takes no arguments, and ignores any that may be present.
437 void DumpWindowStatusChanges();
439 // This function sets a flag that tells the test_shell to print a line of
440 // descriptive text for the progress finished callback. It takes no
441 // arguments, and ignores any that may be present.
442 void DumpProgressFinishedCallback();
444 // This function sets a flag that tells the test_shell to dump all
445 // the lines of descriptive text about spellcheck execution.
446 void DumpSpellCheckCallbacks();
448 // This function sets a flag that tells the test_shell to print out a text
449 // representation of the back/forward list. It ignores all arguments.
450 void DumpBackForwardList();
452 void DumpSelectionRect();
454 // Causes layout to happen as if targetted to printed pages.
455 void SetPrinting();
457 // Clears the state from SetPrinting().
458 void ClearPrinting();
460 void SetShouldStayOnPageAfterHandlingBeforeUnload(bool value);
462 // Causes WillSendRequest to clear certain headers.
463 void SetWillSendRequestClearHeader(const std::string& header);
465 // This function sets a flag that tells the test_shell to dump a descriptive
466 // line for each resource load's priority and any time that priority
467 // changes. It takes no arguments, and ignores any that may be present.
468 void DumpResourceRequestPriorities();
470 // Sets a flag to enable the mock theme.
471 void SetUseMockTheme(bool use);
473 // Sets a flag that causes the test to be marked as completed when the
474 // WebFrameClient receives a loadURLExternally() call.
475 void WaitUntilExternalURLLoad();
477 // This function sets a flag which tells the WebTestProxy to dump the drag
478 // image when the next drag-and-drop is initiated. It is equivalent to
479 // DumpAsTextWithPixelResults but the pixel results will be the drag image
480 // instead of a snapshot of the page.
481 void DumpDragImage();
483 // Sets a flag that tells the WebTestProxy to dump the default navigation
484 // policy passed to the decidePolicyForNavigation callback.
485 void DumpNavigationPolicy();
487 ///////////////////////////////////////////////////////////////////////////
488 // Methods interacting with the WebTestProxy
490 ///////////////////////////////////////////////////////////////////////////
491 // Methods forwarding to the WebTestDelegate
493 // Shows DevTools window.
494 void ShowWebInspector(const std::string& str,
495 const std::string& frontend_url);
496 void CloseWebInspector();
498 // Inspect chooser state
499 bool IsChooserShown();
501 // Allows layout tests to exec scripts at WebInspector side.
502 void EvaluateInWebInspector(int call_id, const std::string& script);
504 // Clears all databases.
505 void ClearAllDatabases();
506 // Sets the default quota for all origins
507 void SetDatabaseQuota(int quota);
509 // Changes the cookie policy from the default to allow all cookies.
510 void SetAlwaysAcceptCookies(bool accept);
512 // Gives focus to the window.
513 void SetWindowIsKey(bool value);
515 // Converts a URL starting with file:///tmp/ to the local mapping.
516 std::string PathToLocalResource(const std::string& path);
518 // Used to set the device scale factor.
519 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback);
521 // Change the device color profile while running a layout test.
522 void SetColorProfile(const std::string& name,
523 v8::Local<v8::Function> callback);
525 // Change the bluetooth test data while running a layout test.
526 void SetBluetoothMockDataSet(const std::string& name);
528 // Enables mock geofencing service while running a layout test.
529 // |service_available| indicates if the mock service should mock geofencing
530 // being available or not.
531 void SetGeofencingMockProvider(bool service_available);
533 // Disables mock geofencing service while running a layout test.
534 void ClearGeofencingMockProvider();
536 // Set the mock geofencing position while running a layout test.
537 void SetGeofencingMockPosition(double latitude, double longitude);
539 // Sets the permission's |name| to |value| for a given {origin, embedder}
540 // tuple.
541 void SetPermission(const std::string& name,
542 const std::string& value,
543 const GURL& origin,
544 const GURL& embedding_origin);
546 // Causes the beforeinstallprompt event to be sent to the renderer.
547 void DispatchBeforeInstallPromptEvent(
548 int request_id,
549 const std::vector<std::string>& event_platforms,
550 v8::Local<v8::Function> callback);
552 // Resolve the beforeinstallprompt event with the matching request id.
553 void ResolveBeforeInstallPromptPromise(int request_id,
554 const std::string& platform);
556 // Calls setlocale(LC_ALL, ...) for a specified locale.
557 // Resets between tests.
558 void SetPOSIXLocale(const std::string& locale);
560 // MIDI function to control permission handling.
561 void SetMIDIAccessorResult(bool result);
563 // Simulates a click on a Web Notification.
564 void SimulateWebNotificationClick(const std::string& title);
566 // Speech recognition related functions.
567 void AddMockSpeechRecognitionResult(const std::string& transcript,
568 double confidence);
569 void SetMockSpeechRecognitionError(const std::string& error,
570 const std::string& message);
571 bool WasMockSpeechRecognitionAborted();
573 // Credential Manager mock functions
574 // TODO(mkwst): Support FederatedCredential.
575 void AddMockCredentialManagerResponse(const std::string& id,
576 const std::string& name,
577 const std::string& avatar,
578 const std::string& password);
580 // WebPageOverlay related functions. Permits the adding and removing of only
581 // one opaque overlay.
582 void AddWebPageOverlay();
583 void RemoveWebPageOverlay();
585 void LayoutAndPaintAsync();
586 void LayoutAndPaintAsyncThen(v8::Local<v8::Function> callback);
588 // Similar to LayoutAndPaintAsyncThen(), but pass parameters of the captured
589 // snapshot (width, height, snapshot) to the callback. The snapshot is in
590 // uint8 RGBA format.
591 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback);
592 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image
593 // located at a particular point in the WebView (if there is such an image),
594 // reads back its pixels, and provides the snapshot to the callback. If there
595 // is no image at that point, calls the callback with (0, 0, empty_snapshot).
596 void CopyImageAtAndCapturePixelsAsyncThen(
597 int x, int y, const v8::Local<v8::Function> callback);
599 void GetManifestThen(v8::Local<v8::Function> callback);
601 ///////////////////////////////////////////////////////////////////////////
602 // Internal helpers
604 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task,
605 const blink::WebURLResponse& response,
606 const std::string& data);
607 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task,
608 const SkBitmap& snapshot);
609 void DispatchBeforeInstallPromptCallback(scoped_ptr<InvokeCallbackTask> task,
610 bool canceled);
612 void CheckResponseMimeType();
613 void CompleteNotifyDone();
615 void DidAcquirePointerLockInternal();
616 void DidNotAcquirePointerLockInternal();
617 void DidLosePointerLockInternal();
619 // In the Mac code, this is called to trigger the end of a test after the
620 // page has finished loading. From here, we can generate the dump for the
621 // test.
622 void LocationChangeDone();
624 // Sets a flag causing the next call to WebGLRenderingContext::create to fail.
625 void ForceNextWebGLContextCreationToFail();
627 // Sets a flag causing the next call to DrawingBuffer::create to fail.
628 void ForceNextDrawingBufferCreationToFail();
630 bool test_is_running_;
632 // When reset is called, go through and close all but the main test shell
633 // window. By default, set to true but toggled to false using
634 // setCloseRemainingWindowsWhenComplete().
635 bool close_remaining_windows_;
637 // If true, don't dump output until notifyDone is called.
638 bool wait_until_done_;
640 // If true, ends the test when a URL is loaded externally via
641 // WebFrameClient::loadURLExternally().
642 bool wait_until_external_url_load_;
644 // Causes navigation actions just printout the intended navigation instead
645 // of taking you to the page. This is used for cases like mailto, where you
646 // don't actually want to open the mail program.
647 bool policy_delegate_enabled_;
649 // Toggles the behavior of the policy delegate. If true, then navigations
650 // will be allowed. Otherwise, they will be ignored (dropped).
651 bool policy_delegate_is_permissive_;
653 // If true, the policy delegate will signal layout test completion.
654 bool policy_delegate_should_notify_done_;
656 WorkQueue work_queue_;
658 // Bound variable to return the name of this platform (chromium).
659 std::string platform_name_;
661 // Bound variable to store the last tooltip text
662 std::string tooltip_text_;
664 // Bound variable to disable notifyDone calls. This is used in GC leak
665 // tests, where existing LayoutTests are loaded within an iframe. The GC
666 // test harness will set this flag to ignore the notifyDone calls from the
667 // target LayoutTest.
668 bool disable_notify_done_;
670 // Bound variable counting the number of top URLs visited.
671 int web_history_item_count_;
673 // Bound variable to set whether postMessages should be intercepted or not
674 bool intercept_post_message_;
676 // If true, the test_shell will write a descriptive line for each editing
677 // command.
678 bool dump_editting_callbacks_;
680 // If true, the test_shell will generate pixel results in DumpAsText mode
681 bool generate_pixel_results_;
683 // If true, the test_shell will produce a plain text dump rather than a
684 // text representation of the renderer.
685 bool dump_as_text_;
687 // If true and if dump_as_text_ is true, the test_shell will recursively
688 // dump all frames as plain text.
689 bool dump_child_frames_as_text_;
691 // If true, the test_shell will produce a dump of the DOM rather than a text
692 // representation of the renderer.
693 bool dump_as_markup_;
695 // If true and if dump_as_markup_ is true, the test_shell will recursively
696 // produce a dump of the DOM rather than a text representation of the
697 // renderer.
698 bool dump_child_frames_as_markup_;
700 // If true, the test_shell will print out the child frame scroll offsets as
701 // well.
702 bool dump_child_frame_scroll_positions_;
704 // If true, the test_shell will print out the icon change notifications.
705 bool dump_icon_changes_;
707 // If true, the test_shell will output a base64 encoded WAVE file.
708 bool dump_as_audio_;
710 // If true, the test_shell will output a descriptive line for each frame
711 // load callback.
712 bool dump_frame_load_callbacks_;
714 // If true, the test_shell will output a descriptive line for each
715 // PingLoader dispatched.
716 bool dump_ping_loader_callbacks_;
718 // If true, the test_shell will output a line of the user gesture status
719 // text for some frame load callbacks.
720 bool dump_user_gesture_in_frame_load_callbacks_;
722 // If true, output a message when the page title is changed.
723 bool dump_title_changes_;
725 // If true, output a descriptive line each time WebViewClient::createView
726 // is invoked.
727 bool dump_create_view_;
729 // If true, new windows can be opened via javascript or by plugins. By
730 // default, set to false and can be toggled to true using
731 // setCanOpenWindows().
732 bool can_open_windows_;
734 // If true, the test_shell will output a descriptive line for each resource
735 // load callback.
736 bool dump_resource_load_callbacks_;
738 // If true, the test_shell will output a descriptive line for each resource
739 // request callback.
740 bool dump_resource_request_callbacks_;
742 // If true, the test_shell will output the MIME type for each resource that
743 // was loaded.
744 bool dump_resource_response_mime_types_;
746 // If true, the test_shell will dump all changes to window.status.
747 bool dump_window_status_changes_;
749 // If true, the test_shell will output a descriptive line for the progress
750 // finished callback.
751 bool dump_progress_finished_callback_;
753 // If true, the test_shell will output descriptive test for spellcheck
754 // execution.
755 bool dump_spell_check_callbacks_;
757 // If true, the test_shell will produce a dump of the back forward list as
758 // well.
759 bool dump_back_forward_list_;
761 // If true, the test_shell will draw the bounds of the current selection rect
762 // taking possible transforms of the selection rect into account.
763 bool dump_selection_rect_;
765 // If true, the test_shell will dump the drag image as pixel results.
766 bool dump_drag_image_;
768 // If true, content_shell will dump the default navigation policy passed to
769 // WebFrameClient::decidePolicyForNavigation.
770 bool dump_navigation_policy_;
772 // If true, pixel dump will be produced as a series of 1px-tall, view-wide
773 // individual paints over the height of the view.
774 bool test_repaint_;
776 // If true and test_repaint_ is true as well, pixel dump will be produced as
777 // a series of 1px-wide, view-tall paints across the width of the view.
778 bool sweep_horizontally_;
780 // If true, layout is to target printed pages.
781 bool is_printing_;
783 // If false, MockWebMIDIAccessor fails on startSession() for testing.
784 bool midi_accessor_result_;
786 bool should_stay_on_page_after_handling_before_unload_;
788 bool should_dump_resource_priorities_;
790 bool has_custom_text_output_;
791 std::string custom_text_output_;
793 std::set<std::string> http_headers_to_clear_;
795 // WAV audio data is stored here.
796 std::vector<unsigned char> audio_data_;
798 // Used for test timeouts.
799 WebTaskList task_list_;
801 TestInterfaces* test_interfaces_;
802 WebTestDelegate* delegate_;
803 blink::WebView* web_view_;
804 TestPageOverlay* page_overlay_;
805 WebTestProxyBase* proxy_;
807 // This is non-0 IFF a load is in progress.
808 blink::WebFrame* top_loading_frame_;
810 // WebContentSettingsClient mock object.
811 scoped_ptr<WebContentSettings> web_content_settings_;
813 bool pointer_locked_;
814 enum {
815 PointerLockWillSucceed,
816 PointerLockWillRespondAsync,
817 PointerLockWillFailSync,
818 } pointer_lock_planned_result_;
819 bool use_mock_theme_;
821 base::WeakPtrFactory<TestRunner> weak_factory_;
823 DISALLOW_COPY_AND_ASSIGN(TestRunner);
826 } // namespace test_runner
828 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_