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