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 8174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8185 // widgets are left in pending-but-not-shown state. | 8185 // widgets are left in pending-but-not-shown state. |
8186 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::Char, | 8186 NativeWebKeyboardEvent event(blink::WebKeyboardEvent::Char, |
8187 blink::WebInputEvent::NoModifiers, | 8187 blink::WebInputEvent::NoModifiers, |
8188 blink::WebInputEvent::TimeStampForTesting); | 8188 blink::WebInputEvent::TimeStampForTesting); |
8189 event.text[0] = ' '; | 8189 event.text[0] = ' '; |
8190 | 8190 |
8191 scoped_refptr<PendingWidgetMessageFilter> filter1 = | 8191 scoped_refptr<PendingWidgetMessageFilter> filter1 = |
8192 new PendingWidgetMessageFilter(); | 8192 new PendingWidgetMessageFilter(); |
8193 process1->AddFilter(filter1.get()); | 8193 process1->AddFilter(filter1.get()); |
8194 EXPECT_TRUE(ExecuteScript(child1, "focusSelectMenu();")); | 8194 EXPECT_TRUE(ExecuteScript(child1, "focusSelectMenu();")); |
8195 child1->current_frame_host()->GetRenderWidgetHost()->ForwardKeyboardEvent( | 8195 child1->current_frame_host() |
8196 event); | 8196 ->GetRenderWidgetHost() |
| 8197 ->ForwardKeyboardEventWithLatencyInfo(event, ui::LatencyInfo()); |
8197 filter1->Wait(); | 8198 filter1->Wait(); |
8198 | 8199 |
8199 scoped_refptr<PendingWidgetMessageFilter> filter2 = | 8200 scoped_refptr<PendingWidgetMessageFilter> filter2 = |
8200 new PendingWidgetMessageFilter(); | 8201 new PendingWidgetMessageFilter(); |
8201 process2->AddFilter(filter2.get()); | 8202 process2->AddFilter(filter2.get()); |
8202 EXPECT_TRUE(ExecuteScript(child2, "focusSelectMenu();")); | 8203 EXPECT_TRUE(ExecuteScript(child2, "focusSelectMenu();")); |
8203 child2->current_frame_host()->GetRenderWidgetHost()->ForwardKeyboardEvent( | 8204 child2->current_frame_host() |
8204 event); | 8205 ->GetRenderWidgetHost() |
| 8206 ->ForwardKeyboardEventWithLatencyInfo(event, ui::LatencyInfo()); |
8205 filter2->Wait(); | 8207 filter2->Wait(); |
8206 | 8208 |
8207 // At this point, we should have two pending widgets. | 8209 // At this point, we should have two pending widgets. |
8208 EXPECT_TRUE(base::ContainsKey( | 8210 EXPECT_TRUE(base::ContainsKey( |
8209 web_contents()->pending_widget_views_, | 8211 web_contents()->pending_widget_views_, |
8210 std::make_pair(process1->GetID(), filter1->routing_id()))); | 8212 std::make_pair(process1->GetID(), filter1->routing_id()))); |
8211 EXPECT_TRUE(base::ContainsKey( | 8213 EXPECT_TRUE(base::ContainsKey( |
8212 web_contents()->pending_widget_views_, | 8214 web_contents()->pending_widget_views_, |
8213 std::make_pair(process2->GetID(), filter2->routing_id()))); | 8215 std::make_pair(process2->GetID(), filter2->routing_id()))); |
8214 | 8216 |
(...skipping 1780 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
9995 names.insert(root->children[0]->frame_entry->frame_unique_name()); | 9997 names.insert(root->children[0]->frame_entry->frame_unique_name()); |
9996 } | 9998 } |
9997 | 9999 |
9998 // More than one entry in the set means that the subframe frame navigation | 10000 // More than one entry in the set means that the subframe frame navigation |
9999 // entries didn't have a consistent unique name. This will break history | 10001 // entries didn't have a consistent unique name. This will break history |
10000 // navigations =( | 10002 // navigations =( |
10001 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; | 10003 EXPECT_THAT(names, SizeIs(1)) << "Mismatched names for subframe!"; |
10002 } | 10004 } |
10003 | 10005 |
10004 } // namespace content | 10006 } // namespace content |
OLD | NEW |