OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 5 #ifndef CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 6 #define CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
211 | 211 |
212 // Executes an internal command (superset of document.execCommand() commands). | 212 // Executes an internal command (superset of document.execCommand() commands). |
213 void ExecCommand(gin::Arguments* args); | 213 void ExecCommand(gin::Arguments* args); |
214 | 214 |
215 // Checks if an internal command is currently available. | 215 // Checks if an internal command is currently available. |
216 bool IsCommandEnabled(const std::string& command); | 216 bool IsCommandEnabled(const std::string& command); |
217 | 217 |
218 bool CallShouldCloseOnWebView(); | 218 bool CallShouldCloseOnWebView(); |
219 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden, | 219 void SetDomainRelaxationForbiddenForURLScheme(bool forbidden, |
220 const std::string& scheme); | 220 const std::string& scheme); |
221 v8::Handle<v8::Value> EvaluateScriptInIsolatedWorldAndReturnValue( | 221 v8::Local<v8::Value> EvaluateScriptInIsolatedWorldAndReturnValue( |
222 int world_id, const std::string& script); | 222 int world_id, const std::string& script); |
223 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); | 223 void EvaluateScriptInIsolatedWorld(int world_id, const std::string& script); |
224 void SetIsolatedWorldSecurityOrigin(int world_id, | 224 void SetIsolatedWorldSecurityOrigin(int world_id, |
225 v8::Handle<v8::Value> origin); | 225 v8::Local<v8::Value> origin); |
226 void SetIsolatedWorldContentSecurityPolicy(int world_id, | 226 void SetIsolatedWorldContentSecurityPolicy(int world_id, |
227 const std::string& policy); | 227 const std::string& policy); |
228 | 228 |
229 // Allows layout tests to manage origins' whitelisting. | 229 // Allows layout tests to manage origins' whitelisting. |
230 void AddOriginAccessWhitelistEntry(const std::string& source_origin, | 230 void AddOriginAccessWhitelistEntry(const std::string& source_origin, |
231 const std::string& destination_protocol, | 231 const std::string& destination_protocol, |
232 const std::string& destination_host, | 232 const std::string& destination_host, |
233 bool allow_destination_subdomains); | 233 bool allow_destination_subdomains); |
234 void RemoveOriginAccessWhitelistEntry(const std::string& source_origin, | 234 void RemoveOriginAccessWhitelistEntry(const std::string& source_origin, |
235 const std::string& destination_protocol, | 235 const std::string& destination_protocol, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 /////////////////////////////////////////////////////////////////////////// | 321 /////////////////////////////////////////////////////////////////////////// |
322 // Methods modifying WebPreferences. | 322 // Methods modifying WebPreferences. |
323 | 323 |
324 // Set the WebPreference that controls webkit's popup blocking. | 324 // Set the WebPreference that controls webkit's popup blocking. |
325 void SetPopupBlockingEnabled(bool block_popups); | 325 void SetPopupBlockingEnabled(bool block_popups); |
326 | 326 |
327 void SetJavaScriptCanAccessClipboard(bool can_access); | 327 void SetJavaScriptCanAccessClipboard(bool can_access); |
328 void SetXSSAuditorEnabled(bool enabled); | 328 void SetXSSAuditorEnabled(bool enabled); |
329 void SetAllowUniversalAccessFromFileURLs(bool allow); | 329 void SetAllowUniversalAccessFromFileURLs(bool allow); |
330 void SetAllowFileAccessFromFileURLs(bool allow); | 330 void SetAllowFileAccessFromFileURLs(bool allow); |
331 void OverridePreference(const std::string key, v8::Handle<v8::Value> value); | 331 void OverridePreference(const std::string key, v8::Local<v8::Value> value); |
332 | 332 |
333 // Modify accept_languages in RendererPreferences. | 333 // Modify accept_languages in RendererPreferences. |
334 void SetAcceptLanguages(const std::string& accept_languages); | 334 void SetAcceptLanguages(const std::string& accept_languages); |
335 | 335 |
336 // Enable or disable plugins. | 336 // Enable or disable plugins. |
337 void SetPluginsEnabled(bool enabled); | 337 void SetPluginsEnabled(bool enabled); |
338 | 338 |
339 /////////////////////////////////////////////////////////////////////////// | 339 /////////////////////////////////////////////////////////////////////////// |
340 // Methods that modify the state of TestRunner | 340 // Methods that modify the state of TestRunner |
341 | 341 |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 // Changes the cookie policy from the default to allow all cookies. | 507 // Changes the cookie policy from the default to allow all cookies. |
508 void SetAlwaysAcceptCookies(bool accept); | 508 void SetAlwaysAcceptCookies(bool accept); |
509 | 509 |
510 // Gives focus to the window. | 510 // Gives focus to the window. |
511 void SetWindowIsKey(bool value); | 511 void SetWindowIsKey(bool value); |
512 | 512 |
513 // Converts a URL starting with file:///tmp/ to the local mapping. | 513 // Converts a URL starting with file:///tmp/ to the local mapping. |
514 std::string PathToLocalResource(const std::string& path); | 514 std::string PathToLocalResource(const std::string& path); |
515 | 515 |
516 // Used to set the device scale factor. | 516 // Used to set the device scale factor. |
517 void SetBackingScaleFactor(double value, v8::Handle<v8::Function> callback); | 517 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); |
518 | 518 |
519 // Change the device color profile while running a layout test. | 519 // Change the device color profile while running a layout test. |
520 void SetColorProfile(const std::string& name, | 520 void SetColorProfile(const std::string& name, |
521 v8::Handle<v8::Function> callback); | 521 v8::Local<v8::Function> callback); |
522 | 522 |
523 // Change the bluetooth test data while running a layout test. | 523 // Change the bluetooth test data while running a layout test. |
524 void SetBluetoothMockDataSet(const std::string& name); | 524 void SetBluetoothMockDataSet(const std::string& name); |
525 | 525 |
526 // Enables mock geofencing service while running a layout test. | 526 // Enables mock geofencing service while running a layout test. |
527 // |service_available| indicates if the mock service should mock geofencing | 527 // |service_available| indicates if the mock service should mock geofencing |
528 // being available or not. | 528 // being available or not. |
529 void SetGeofencingMockProvider(bool service_available); | 529 void SetGeofencingMockProvider(bool service_available); |
530 | 530 |
531 // Disables mock geofencing service while running a layout test. | 531 // Disables mock geofencing service while running a layout test. |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
564 const std::string& name, | 564 const std::string& name, |
565 const std::string& avatar, | 565 const std::string& avatar, |
566 const std::string& password); | 566 const std::string& password); |
567 | 567 |
568 // WebPageOverlay related functions. Permits the adding and removing of only | 568 // WebPageOverlay related functions. Permits the adding and removing of only |
569 // one opaque overlay. | 569 // one opaque overlay. |
570 void AddWebPageOverlay(); | 570 void AddWebPageOverlay(); |
571 void RemoveWebPageOverlay(); | 571 void RemoveWebPageOverlay(); |
572 | 572 |
573 void DisplayAsync(); | 573 void DisplayAsync(); |
574 void DisplayAsyncThen(v8::Handle<v8::Function> callback); | 574 void DisplayAsyncThen(v8::Local<v8::Function> callback); |
575 | 575 |
576 // Similar to DisplayAsyncThen(), but pass parameters of the captured | 576 // Similar to DisplayAsyncThen(), but pass parameters of the captured |
577 // snapshot (width, height, snapshot) to the callback. The snapshot is in | 577 // snapshot (width, height, snapshot) to the callback. The snapshot is in |
578 // uint8 RGBA format. | 578 // uint8 RGBA format. |
579 void CapturePixelsAsyncThen(v8::Handle<v8::Function> callback); | 579 void CapturePixelsAsyncThen(v8::Local<v8::Function> callback); |
580 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image | 580 // Similar to CapturePixelsAsyncThen(). Copies to the clipboard the image |
581 // located at a particular point in the WebView (if there is such an image), | 581 // located at a particular point in the WebView (if there is such an image), |
582 // reads back its pixels, and provides the snapshot to the callback. If there | 582 // reads back its pixels, and provides the snapshot to the callback. If there |
583 // is no image at that point, calls the callback with (0, 0, empty_snapshot). | 583 // is no image at that point, calls the callback with (0, 0, empty_snapshot). |
584 void CopyImageAtAndCapturePixelsAsyncThen( | 584 void CopyImageAtAndCapturePixelsAsyncThen( |
585 int x, int y, const v8::Handle<v8::Function> callback); | 585 int x, int y, const v8::Local<v8::Function> callback); |
586 | 586 |
587 void GetManifestThen(v8::Handle<v8::Function> callback); | 587 void GetManifestThen(v8::Local<v8::Function> callback); |
588 | 588 |
589 /////////////////////////////////////////////////////////////////////////// | 589 /////////////////////////////////////////////////////////////////////////// |
590 // Internal helpers | 590 // Internal helpers |
591 | 591 |
592 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task, | 592 void GetManifestCallback(scoped_ptr<InvokeCallbackTask> task, |
593 const blink::WebURLResponse& response, | 593 const blink::WebURLResponse& response, |
594 const std::string& data); | 594 const std::string& data); |
595 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task, | 595 void CapturePixelsCallback(scoped_ptr<InvokeCallbackTask> task, |
596 const SkBitmap& snapshot); | 596 const SkBitmap& snapshot); |
597 | 597 |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 bool use_mock_theme_; | 802 bool use_mock_theme_; |
803 | 803 |
804 base::WeakPtrFactory<TestRunner> weak_factory_; | 804 base::WeakPtrFactory<TestRunner> weak_factory_; |
805 | 805 |
806 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 806 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
807 }; | 807 }; |
808 | 808 |
809 } // namespace content | 809 } // namespace content |
810 | 810 |
811 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ | 811 #endif // CONTENT_SHELL_RENDERER_TEST_RUNNER_TEST_RUNNER_H_ |
OLD | NEW |