OLD | NEW |
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 8291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8302 // widgets are left in pending-but-not-shown state. | 8302 // widgets are left in pending-but-not-shown state. |
8303 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kChar, | 8303 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::kChar, |
8304 blink::WebInputEvent::kNoModifiers, | 8304 blink::WebInputEvent::kNoModifiers, |
8305 blink::WebInputEvent::kTimeStampForTesting); | 8305 blink::WebInputEvent::kTimeStampForTesting); |
8306 event.text[0] = ' '; | 8306 event.text[0] = ' '; |
8307 | 8307 |
8308 scoped_refptr<PendingWidgetMessageFilter> filter1 = | 8308 scoped_refptr<PendingWidgetMessageFilter> filter1 = |
8309 new PendingWidgetMessageFilter(); | 8309 new PendingWidgetMessageFilter(); |
8310 process1->AddFilter(filter1.get()); | 8310 process1->AddFilter(filter1.get()); |
8311 EXPECT_TRUE(ExecuteScript(child1, "focusSelectMenu();")); | 8311 EXPECT_TRUE(ExecuteScript(child1, "focusSelectMenu();")); |
8312 child1->current_frame_host()->GetRenderWidgetHost()->ForwardKeyboardEvent( | 8312 child1->current_frame_host() |
8313 event); | 8313 ->GetRenderWidgetHost() |
| 8314 ->ForwardKeyboardEventWithLatencyInfo(event, ui::LatencyInfo()); |
8314 filter1->Wait(); | 8315 filter1->Wait(); |
8315 | 8316 |
8316 scoped_refptr<PendingWidgetMessageFilter> filter2 = | 8317 scoped_refptr<PendingWidgetMessageFilter> filter2 = |
8317 new PendingWidgetMessageFilter(); | 8318 new PendingWidgetMessageFilter(); |
8318 process2->AddFilter(filter2.get()); | 8319 process2->AddFilter(filter2.get()); |
8319 EXPECT_TRUE(ExecuteScript(child2, "focusSelectMenu();")); | 8320 EXPECT_TRUE(ExecuteScript(child2, "focusSelectMenu();")); |
8320 child2->current_frame_host()->GetRenderWidgetHost()->ForwardKeyboardEvent( | 8321 child2->current_frame_host() |
8321 event); | 8322 ->GetRenderWidgetHost() |
| 8323 ->ForwardKeyboardEventWithLatencyInfo(event, ui::LatencyInfo()); |
8322 filter2->Wait(); | 8324 filter2->Wait(); |
8323 | 8325 |
8324 // At this point, we should have two pending widgets. | 8326 // At this point, we should have two pending widgets. |
8325 EXPECT_TRUE(base::ContainsKey( | 8327 EXPECT_TRUE(base::ContainsKey( |
8326 web_contents()->pending_widget_views_, | 8328 web_contents()->pending_widget_views_, |
8327 std::make_pair(process1->GetID(), filter1->routing_id()))); | 8329 std::make_pair(process1->GetID(), filter1->routing_id()))); |
8328 EXPECT_TRUE(base::ContainsKey( | 8330 EXPECT_TRUE(base::ContainsKey( |
8329 web_contents()->pending_widget_views_, | 8331 web_contents()->pending_widget_views_, |
8330 std::make_pair(process2->GetID(), filter2->routing_id()))); | 8332 std::make_pair(process2->GetID(), filter2->routing_id()))); |
8331 | 8333 |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10112 names.insert(root->children[0]->frame_entry->frame_unique_name()); | 10114 names.insert(root->children[0]->frame_entry->frame_unique_name()); |
10113 } | 10115 } |
10114 | 10116 |
10115 // More than one entry in the set means that the subframe frame navigation | 10117 // More than one entry in the set means that the subframe frame navigation |
10116 // entries didn't have a consistent unique name. This will break history | 10118 // entries didn't have a consistent unique name. This will break history |
10117 // navigations =( | 10119 // navigations =( |
10118 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; | 10120 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; |
10119 } | 10121 } |
10120 | 10122 |
10121 } // namespace content | 10123 } // namespace content |
OLD | NEW |