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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 std::string DumpLayout(blink::WebLocalFrame* frame) override; | 76 std::string DumpLayout(blink::WebLocalFrame* frame) override; |
77 void DumpPixelsAsync( | 77 void DumpPixelsAsync( |
78 blink::WebView* web_view, | 78 blink::WebView* web_view, |
79 const base::Callback<void(const SkBitmap&)>& callback) override; | 79 const base::Callback<void(const SkBitmap&)>& callback) override; |
80 void ReplicateLayoutTestRuntimeFlagsChanges( | 80 void ReplicateLayoutTestRuntimeFlagsChanges( |
81 const base::DictionaryValue& changed_values) override; | 81 const base::DictionaryValue& changed_values) override; |
82 bool HasCustomTextDump(std::string* custom_text_dump) const override; | 82 bool HasCustomTextDump(std::string* custom_text_dump) const override; |
83 bool ShouldDumpBackForwardList() const override; | 83 bool ShouldDumpBackForwardList() const override; |
84 blink::WebContentSettingsClient* GetWebContentSettings() const override; | 84 blink::WebContentSettingsClient* GetWebContentSettings() const override; |
85 void InitializeWebViewWithMocks(blink::WebView* web_view) override; | 85 void InitializeWebViewWithMocks(blink::WebView* web_view) override; |
| 86 void SetFocus(blink::WebView* web_view, bool focus) override; |
86 | 87 |
87 // Methods used by WebViewTestClient and WebFrameTestClient. | 88 // Methods used by WebViewTestClient and WebFrameTestClient. |
88 void OnAnimationScheduled(blink::WebView* view); | 89 void OnAnimationScheduled(blink::WebView* view); |
89 void OnAnimationBegun(blink::WebView* view); | 90 void OnAnimationBegun(blink::WebView* view); |
90 std::string GetAcceptLanguages() const; | 91 std::string GetAcceptLanguages() const; |
91 bool shouldStayOnPageAfterHandlingBeforeUnload() const; | 92 bool shouldStayOnPageAfterHandlingBeforeUnload() const; |
92 MockScreenOrientationClient* getMockScreenOrientationClient(); | 93 MockScreenOrientationClient* getMockScreenOrientationClient(); |
93 MockWebUserMediaClient* getMockWebUserMediaClient(); | 94 MockWebUserMediaClient* getMockWebUserMediaClient(); |
94 MockWebSpeechRecognizer* getMockWebSpeechRecognizer(); | 95 MockWebSpeechRecognizer* getMockWebSpeechRecognizer(); |
95 bool isPrinting() const; | 96 bool isPrinting() const; |
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 std::string EvaluateInWebInspectorOverlay(const std::string& script); | 516 std::string EvaluateInWebInspectorOverlay(const std::string& script); |
516 | 517 |
517 // Clears all databases. | 518 // Clears all databases. |
518 void ClearAllDatabases(); | 519 void ClearAllDatabases(); |
519 // Sets the default quota for all origins | 520 // Sets the default quota for all origins |
520 void SetDatabaseQuota(int quota); | 521 void SetDatabaseQuota(int quota); |
521 | 522 |
522 // Changes the cookie policy from the default to allow all cookies. | 523 // Changes the cookie policy from the default to allow all cookies. |
523 void SetAlwaysAcceptCookies(bool accept); | 524 void SetAlwaysAcceptCookies(bool accept); |
524 | 525 |
525 // Gives focus to the window. | 526 // Gives focus to the main test window. |
526 void SetWindowIsKey(bool value); | 527 void SetWindowIsKey(bool value); |
527 | 528 |
528 // Converts a URL starting with file:///tmp/ to the local mapping. | 529 // Converts a URL starting with file:///tmp/ to the local mapping. |
529 std::string PathToLocalResource(const std::string& path); | 530 std::string PathToLocalResource(const std::string& path); |
530 | 531 |
531 // Used to set the device scale factor. | 532 // Used to set the device scale factor. |
532 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); | 533 void SetBackingScaleFactor(double value, v8::Local<v8::Function> callback); |
533 | 534 |
534 // Enable zoom-for-dsf option. | 535 // Enable zoom-for-dsf option. |
535 // TODO(oshima): Remove this once all platforms migrated. | 536 // TODO(oshima): Remove this once all platforms migrated. |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; | 811 scoped_ptr<MockWebSpeechRecognizer> speech_recognizer_; |
811 scoped_ptr<MockWebUserMediaClient> user_media_client_; | 812 scoped_ptr<MockWebUserMediaClient> user_media_client_; |
812 scoped_ptr<SpellCheckClient> spellcheck_; | 813 scoped_ptr<SpellCheckClient> spellcheck_; |
813 | 814 |
814 // Number of currently active color choosers. | 815 // Number of currently active color choosers. |
815 int chooser_count_; | 816 int chooser_count_; |
816 | 817 |
817 // Captured drag image. | 818 // Captured drag image. |
818 blink::WebImage drag_image_; | 819 blink::WebImage drag_image_; |
819 | 820 |
| 821 // View that was focused by a previous call to TestRunner::SetFocus method. |
| 822 // Note - this can be a dangling pointer to an already destroyed WebView (this |
| 823 // is ok, because this is taken care of in WebTestDelegate::SetFocus). |
| 824 blink::WebView* previously_focused_view_; |
| 825 |
820 std::set<blink::WebView*> views_with_scheduled_animations_; | 826 std::set<blink::WebView*> views_with_scheduled_animations_; |
821 | 827 |
822 base::WeakPtrFactory<TestRunner> weak_factory_; | 828 base::WeakPtrFactory<TestRunner> weak_factory_; |
823 | 829 |
824 DISALLOW_COPY_AND_ASSIGN(TestRunner); | 830 DISALLOW_COPY_AND_ASSIGN(TestRunner); |
825 }; | 831 }; |
826 | 832 |
827 } // namespace test_runner | 833 } // namespace test_runner |
828 | 834 |
829 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ | 835 #endif // COMPONENTS_TEST_RUNNER_TEST_RUNNER_H_ |
OLD | NEW |