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

Side by Side Diff: content/browser/site_per_process_browsertest.cc

Issue 2387353004: Delay Input.dispatchKeyEvent response until after key event ack. (Closed)
Patch Set: add test, address review comments about docs Created 4 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/browser/site_per_process_browsertest.h" 5 #include "content/browser/site_per_process_browsertest.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 return events_received_.front(); 197 return events_received_.front();
198 } 198 }
199 const std::vector<blink::WebInputEvent::Type>& events_received() { 199 const std::vector<blink::WebInputEvent::Type>& events_received() {
200 return events_received_; 200 return events_received_;
201 } 201 }
202 202
203 void OnInputEvent(const blink::WebInputEvent& event) override { 203 void OnInputEvent(const blink::WebInputEvent& event) override {
204 events_received_.push_back(event.type); 204 events_received_.push_back(event.type);
205 }; 205 };
206 206
207 void OnInputEventAck(const blink::WebInputEvent& event, bool is_synthetic)
208 override {};
209
207 private: 210 private:
208 RenderWidgetHost* host_; 211 RenderWidgetHost* host_;
209 std::vector<blink::WebInputEvent::Type> events_received_; 212 std::vector<blink::WebInputEvent::Type> events_received_;
210 213
211 DISALLOW_COPY_AND_ASSIGN(TestInputEventObserver); 214 DISALLOW_COPY_AND_ASSIGN(TestInputEventObserver);
212 }; 215 };
213 216
214 // Helper function that performs a surface hittest. 217 // Helper function that performs a surface hittest.
215 void SurfaceHitTestTestHelper( 218 void SurfaceHitTestTestHelper(
216 Shell* shell, 219 Shell* shell,
(...skipping 8299 matching lines...) Expand 10 before | Expand all | Expand 10 after
8516 EXPECT_TRUE(NavigateToURL(shell(), b_url)); 8519 EXPECT_TRUE(NavigateToURL(shell(), b_url));
8517 8520
8518 base::string16 expected_title(base::UTF8ToUTF16("foo")); 8521 base::string16 expected_title(base::UTF8ToUTF16("foo"));
8519 TitleWatcher title_watcher(popup2->web_contents(), expected_title); 8522 TitleWatcher title_watcher(popup2->web_contents(), expected_title);
8520 EXPECT_TRUE(ExecuteScript( 8523 EXPECT_TRUE(ExecuteScript(
8521 shell(), "window.open('','popup2').postMessage('foo', '*');")); 8524 shell(), "window.open('','popup2').postMessage('foo', '*');"));
8522 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 8525 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
8523 } 8526 }
8524 8527
8525 } // namespace content 8528 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698