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