Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: components/test_runner/test_runner.h

Issue 1886013002: Track focused view in TestRunner instead of in BlinkTestRunner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/test_runner/test_runner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/test_runner/test_runner.h
diff --git a/components/test_runner/test_runner.h b/components/test_runner/test_runner.h
index eecf7c317f4655955dfeebe67bf26e560f729b3d..ea3380ab6a54c3d0d74daa1e46b0d42382dd8e72 100644
--- a/components/test_runner/test_runner.h
+++ b/components/test_runner/test_runner.h
@@ -83,6 +83,7 @@ class TestRunner : public WebTestRunner {
bool ShouldDumpBackForwardList() const override;
blink::WebContentSettingsClient* GetWebContentSettings() const override;
void InitializeWebViewWithMocks(blink::WebView* web_view) override;
+ void SetFocus(blink::WebView* web_view, bool focus) override;
// Methods used by WebViewTestClient and WebFrameTestClient.
void OnAnimationScheduled(blink::WebView* view);
@@ -522,7 +523,7 @@ class TestRunner : public WebTestRunner {
// Changes the cookie policy from the default to allow all cookies.
void SetAlwaysAcceptCookies(bool accept);
- // Gives focus to the window.
+ // Gives focus to the main test window.
void SetWindowIsKey(bool value);
// Converts a URL starting with file:///tmp/ to the local mapping.
@@ -817,6 +818,11 @@ class TestRunner : public WebTestRunner {
// Captured drag image.
blink::WebImage drag_image_;
+ // View that was focused by a previous call to TestRunner::SetFocus method.
+ // Note - this can be a dangling pointer to an already destroyed WebView (this
+ // is ok, because this is taken care of in WebTestDelegate::SetFocus).
+ blink::WebView* previously_focused_view_;
+
std::set<blink::WebView*> views_with_scheduled_animations_;
base::WeakPtrFactory<TestRunner> weak_factory_;
« no previous file with comments | « no previous file | components/test_runner/test_runner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698