| 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 |
| 11 #include "components/test_runner/layout_dump_flags.h" | 11 namespace test_runner { |
| 12 struct LayoutDumpFlags; |
| 13 } |
| 12 | 14 |
| 13 namespace blink { | 15 namespace blink { |
| 14 class WebContentSettingsClient; | 16 class WebContentSettingsClient; |
| 15 } | 17 } |
| 16 | 18 |
| 17 namespace test_runner { | 19 namespace test_runner { |
| 18 | 20 |
| 19 class WebTestRunner { | 21 class WebTestRunner { |
| 20 public: | 22 public: |
| 21 // Returns a mock WebContentSettings that is used for layout tests. An | 23 // Returns a mock WebContentSettings that is used for layout tests. An |
| 22 // embedder should use this for all WebViews it creates. | 24 // embedder should use this for all WebViews it creates. |
| 23 virtual blink::WebContentSettingsClient* GetWebContentSettings() const = 0; | 25 virtual blink::WebContentSettingsClient* GetWebContentSettings() const = 0; |
| 24 | 26 |
| 25 // After WebTestDelegate::TestFinished was invoked, the following methods | 27 // After WebTestDelegate::TestFinished was invoked, the following methods |
| 26 // can be used to determine what kind of dump the main WebTestProxy can | 28 // can be used to determine what kind of dump the main WebTestProxy can |
| 27 // provide. | 29 // provide. |
| 28 | 30 |
| 29 // If true, WebTestDelegate::audioData returns an audio dump and no text | 31 // If true, WebTestDelegate::audioData returns an audio dump and no text |
| 30 // or pixel results are available. | 32 // or pixel results are available. |
| 31 virtual bool ShouldDumpAsAudio() const = 0; | 33 virtual bool ShouldDumpAsAudio() const = 0; |
| 32 virtual void GetAudioData(std::vector<unsigned char>* buffer_view) const = 0; | 34 virtual void GetAudioData(std::vector<unsigned char>* buffer_view) const = 0; |
| 33 | 35 |
| 34 // Gets layout dump flags (i.e. dump-as-text or dump-as-markup) requested | 36 // Gets layout dump flags (i.e. dump-as-text or dump-as-markup) requested |
| 35 // by the test (i.e. via testRunner.dumpAsText() called from javascript). | 37 // by the test (i.e. via testRunner.dumpAsText() called from javascript). |
| 36 virtual LayoutDumpFlags GetLayoutDumpFlags() = 0; | 38 virtual const LayoutDumpFlags& GetLayoutDumpFlags() = 0; |
| 37 | 39 |
| 38 // If custom text dump is present (i.e. if testRunner.setCustomTextOutput has | 40 // If custom text dump is present (i.e. if testRunner.setCustomTextOutput has |
| 39 // been called from javascript), then returns |true| and populates the | 41 // been called from javascript), then returns |true| and populates the |
| 40 // |custom_text_dump| argument. Otherwise returns |false|. | 42 // |custom_text_dump| argument. Otherwise returns |false|. |
| 41 virtual bool HasCustomTextDump(std::string* custom_text_dump) const = 0; | 43 virtual bool HasCustomTextDump(std::string* custom_text_dump) const = 0; |
| 42 | 44 |
| 43 // Returns true if the call to WebTestProxy::captureTree will invoke | 45 // Returns true if the call to WebTestProxy::captureTree will invoke |
| 44 // WebTestDelegate::captureHistoryForWindow. | 46 // WebTestDelegate::captureHistoryForWindow. |
| 45 virtual bool ShouldDumpBackForwardList() const = 0; | 47 virtual bool ShouldDumpBackForwardList() const = 0; |
| 46 | 48 |
| 47 // Returns true if WebTestProxy::capturePixels should be invoked after | 49 // Returns true if WebTestProxy::capturePixels should be invoked after |
| 48 // capturing text results. | 50 // capturing text results. |
| 49 virtual bool ShouldGeneratePixelResults() = 0; | 51 virtual bool ShouldGeneratePixelResults() = 0; |
| 50 | 52 |
| 51 virtual bool ShouldStayOnPageAfterHandlingBeforeUnload() const = 0; | 53 virtual bool ShouldStayOnPageAfterHandlingBeforeUnload() const = 0; |
| 52 }; | 54 }; |
| 53 | 55 |
| 54 } // namespace test_runner | 56 } // namespace test_runner |
| 55 | 57 |
| 56 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ | 58 #endif // COMPONENTS_TEST_RUNNER_WEB_TEST_RUNNER_H_ |
| OLD | NEW |