| 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 COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 6 #define COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <deque> | 10 #include <deque> |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class MockWebUserMediaClient; | 47 class MockWebUserMediaClient; |
| 48 class SpellCheckClient; | 48 class SpellCheckClient; |
| 49 class TestInterfaces; | 49 class TestInterfaces; |
| 50 class TestRunnerForSpecificView; | 50 class TestRunnerForSpecificView; |
| 51 class WebTestDelegate; | 51 class WebTestDelegate; |
| 52 | 52 |
| 53 // TestRunner class currently has dual purpose: | 53 // TestRunner class currently has dual purpose: |
| 54 // 1. It implements |testRunner| javascript bindings for "global" / "ambient". | 54 // 1. It implements |testRunner| javascript bindings for "global" / "ambient". |
| 55 // Examples: | 55 // Examples: |
| 56 // - testRunner.dumpAsText (test flag affecting test behavior) | 56 // - testRunner.dumpAsText (test flag affecting test behavior) |
| 57 // - testRunner.setAllowDisplayOfInsecureContent (test flag affecting product | 57 // - testRunner.setAllowRunningOfInsecureContent (test flag affecting product |
| 58 // behavior) | 58 // behavior) |
| 59 // - testRunner.setTextSubpixelPositioning (directly interacts with product). | 59 // - testRunner.setTextSubpixelPositioning (directly interacts with product). |
| 60 // Note that "per-view" (non-"global") bindings are handled by | 60 // Note that "per-view" (non-"global") bindings are handled by |
| 61 // instances of TestRunnerForSpecificView class. | 61 // instances of TestRunnerForSpecificView class. |
| 62 // 2. It manages global test state. Example: | 62 // 2. It manages global test state. Example: |
| 63 // - Tracking topLoadingFrame that can finish the test when it loads. | 63 // - Tracking topLoadingFrame that can finish the test when it loads. |
| 64 // - WorkQueue holding load requests from the TestInterfaces | 64 // - WorkQueue holding load requests from the TestInterfaces |
| 65 // - LayoutTestRuntimeFlags | 65 // - LayoutTestRuntimeFlags |
| 66 class TestRunner : public WebTestRunner { | 66 class TestRunner : public WebTestRunner { |
| 67 public: | 67 public: |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 // This function sets a flag that tells the test_shell to dump the MIME type | 398 // This function sets a flag that tells the test_shell to dump the MIME type |
| 399 // for each resource that was loaded. It takes no arguments, and ignores any | 399 // for each resource that was loaded. It takes no arguments, and ignores any |
| 400 // that may be present. | 400 // that may be present. |
| 401 void DumpResourceResponseMIMETypes(); | 401 void DumpResourceResponseMIMETypes(); |
| 402 | 402 |
| 403 // WebContentSettingsClient related. | 403 // WebContentSettingsClient related. |
| 404 void SetImagesAllowed(bool allowed); | 404 void SetImagesAllowed(bool allowed); |
| 405 void SetScriptsAllowed(bool allowed); | 405 void SetScriptsAllowed(bool allowed); |
| 406 void SetStorageAllowed(bool allowed); | 406 void SetStorageAllowed(bool allowed); |
| 407 void SetPluginsAllowed(bool allowed); | 407 void SetPluginsAllowed(bool allowed); |
| 408 void SetAllowDisplayOfInsecureContent(bool allowed); | |
| 409 void SetAllowRunningOfInsecureContent(bool allowed); | 408 void SetAllowRunningOfInsecureContent(bool allowed); |
| 410 void SetAutoplayAllowed(bool allowed); | 409 void SetAutoplayAllowed(bool allowed); |
| 411 void DumpPermissionClientCallbacks(); | 410 void DumpPermissionClientCallbacks(); |
| 412 | 411 |
| 413 // Sets up a mock DocumentSubresourceFilter to disallow subsequent subresource | 412 // Sets up a mock DocumentSubresourceFilter to disallow subsequent subresource |
| 414 // loads within the current document with the given path |suffixes|. The | 413 // loads within the current document with the given path |suffixes|. The |
| 415 // filter is created and injected even if |suffixes| is empty. If |suffixes| | 414 // filter is created and injected even if |suffixes| is empty. If |suffixes| |
| 416 // contains the empty string, all subresource loads will be disallowed. | 415 // contains the empty string, all subresource loads will be disallowed. |
| 417 void SetDisallowedSubresourcePathSuffixes( | 416 void SetDisallowedSubresourcePathSuffixes( |
| 418 const std::vector<std::string>& suffixes); | 417 const std::vector<std::string>& suffixes); |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 bool is_web_platform_tests_mode_; | 641 bool is_web_platform_tests_mode_; |
| 643 | 642 |
| 644 base::WeakPtrFactory<TestRunner> weak_factory_; | 643 base::WeakPtrFactory<TestRunner> weak_factory_; |
| 645 | 644 |
| 646 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 645 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
| 647 }; | 646 }; |
| 648 | 647 |
| 649 } // namespace test_runner | 648 } // namespace test_runner |
| 650 | 649 |
| 651 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 650 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
| OLD | NEW |