| 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_WEB_TEST_RUNNER_H_ | 5 #ifndef COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ |
| 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ | 6 #define COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace test_runner { | 25 namespace test_runner { |
| 26 | 26 |
| 27 class WebTestRunner { | 27 class WebTestRunner { |
| 28 public: | 28 public: |
| 29 // Returns a mock WebContentSettings that is used for layout tests. An | 29 // Returns a mock WebContentSettings that is used for layout tests. An |
| 30 // embedder should use this for all WebViews it creates. | 30 // embedder should use this for all WebViews it creates. |
| 31 virtual blink::WebContentSettingsClient* GetWebContentSettings() const = 0; | 31 virtual blink::WebContentSettingsClient* GetWebContentSettings() const = 0; |
| 32 | 32 |
| 33 // After WebTestDelegate::TestFinished was invoked, the following methods | 33 // After WebTestDelegate::TestFinished was invoked, the following methods |
| 34 // can be used to determine what kind of dump the main WebTestProxy can | 34 // can be used to determine what kind of dump the main WebViewTestProxy can |
| 35 // provide. | 35 // provide. |
| 36 | 36 |
| 37 // If true, WebTestDelegate::audioData returns an audio dump and no text | 37 // If true, WebTestDelegate::audioData returns an audio dump and no text |
| 38 // or pixel results are available. | 38 // or pixel results are available. |
| 39 virtual bool ShouldDumpAsAudio() const = 0; | 39 virtual bool ShouldDumpAsAudio() const = 0; |
| 40 virtual void GetAudioData(std::vector<unsigned char>* buffer_view) const = 0; | 40 virtual void GetAudioData(std::vector<unsigned char>* buffer_view) const = 0; |
| 41 | 41 |
| 42 // Reports if tests requested a recursive layout dump of all frames | 42 // Reports if tests requested a recursive layout dump of all frames |
| 43 // (i.e. by calling testRunner.dumpChildFramesAsText() from javascript). | 43 // (i.e. by calling testRunner.dumpChildFramesAsText() from javascript). |
| 44 virtual bool IsRecursiveLayoutDumpRequested() = 0; | 44 virtual bool IsRecursiveLayoutDumpRequested() = 0; |
| (...skipping 13 matching lines...) Expand all Loading... |
| 58 // (i.e. changes that happened in another renderer). | 58 // (i.e. changes that happened in another renderer). |
| 59 // See also WebTestDelegate::OnLayoutTestRuntimeFlagsChanged. | 59 // See also WebTestDelegate::OnLayoutTestRuntimeFlagsChanged. |
| 60 virtual void ReplicateLayoutTestRuntimeFlagsChanges( | 60 virtual void ReplicateLayoutTestRuntimeFlagsChanges( |
| 61 const base::DictionaryValue& changed_values) = 0; | 61 const base::DictionaryValue& changed_values) = 0; |
| 62 | 62 |
| 63 // If custom text dump is present (i.e. if testRunner.setCustomTextOutput has | 63 // If custom text dump is present (i.e. if testRunner.setCustomTextOutput has |
| 64 // been called from javascript), then returns |true| and populates the | 64 // been called from javascript), then returns |true| and populates the |
| 65 // |custom_text_dump| argument. Otherwise returns |false|. | 65 // |custom_text_dump| argument. Otherwise returns |false|. |
| 66 virtual bool HasCustomTextDump(std::string* custom_text_dump) const = 0; | 66 virtual bool HasCustomTextDump(std::string* custom_text_dump) const = 0; |
| 67 | 67 |
| 68 // Returns true if the call to WebTestProxy::captureTree will invoke | 68 // Returns true if the call to WebViewTestProxy::captureTree will invoke |
| 69 // WebTestDelegate::captureHistoryForWindow. | 69 // WebTestDelegate::captureHistoryForWindow. |
| 70 virtual bool ShouldDumpBackForwardList() const = 0; | 70 virtual bool ShouldDumpBackForwardList() const = 0; |
| 71 | 71 |
| 72 // Returns true if WebTestProxy::capturePixels should be invoked after | 72 // Returns true if WebViewTestProxy::capturePixels should be invoked after |
| 73 // capturing text results. | 73 // capturing text results. |
| 74 virtual bool ShouldGeneratePixelResults() = 0; | 74 virtual bool ShouldGeneratePixelResults() = 0; |
| 75 | 75 |
| 76 // Sets various interfaces consumed by WebView to implementations providing | 76 // Sets various interfaces consumed by WebView to implementations providing |
| 77 // test behavior. This method covers interfaces that are not exposed via | 77 // test behavior. This method covers interfaces that are not exposed via |
| 78 // WebViewClient (and are covered by WebViewTestClient) - for example this | 78 // WebViewClient (and are covered by WebViewTestClient) - for example this |
| 79 // method covers blink::WebCredentialManagerClient and | 79 // method covers blink::WebCredentialManagerClient and |
| 80 // blink::WebSpellCheckClient. | 80 // blink::WebSpellCheckClient. |
| 81 virtual void InitializeWebViewWithMocks(blink::WebView* web_view) = 0; | 81 virtual void InitializeWebViewWithMocks(blink::WebView* web_view) = 0; |
| 82 | 82 |
| 83 // Sets focus on the given view. Internally tracks currently focused view, | 83 // Sets focus on the given view. Internally tracks currently focused view, |
| 84 // to aid in defocusing previously focused views at the right time. | 84 // to aid in defocusing previously focused views at the right time. |
| 85 virtual void SetFocus(blink::WebView* web_view, bool focus) = 0; | 85 virtual void SetFocus(blink::WebView* web_view, bool focus) = 0; |
| 86 }; | 86 }; |
| 87 | 87 |
| 88 } // namespace test_runner | 88 } // namespace test_runner |
| 89 | 89 |
| 90 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ | 90 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ |
| OLD | NEW |