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

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

Issue 2969233002: Fixed failing content_browsertests when async wheel events is on. (Closed)
Patch Set: Fixed failing content_browsertests when async wheel events is on Created 3 years, 5 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
« no previous file with comments | « content/browser/pointer_lock_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
57 #include "content/common/view_messages.h" 57 #include "content/common/view_messages.h"
58 #include "content/public/browser/browser_context.h" 58 #include "content/public/browser/browser_context.h"
59 #include "content/public/browser/browser_thread.h" 59 #include "content/public/browser/browser_thread.h"
60 #include "content/public/browser/interstitial_page_delegate.h" 60 #include "content/public/browser/interstitial_page_delegate.h"
61 #include "content/public/browser/navigation_handle.h" 61 #include "content/public/browser/navigation_handle.h"
62 #include "content/public/browser/notification_observer.h" 62 #include "content/public/browser/notification_observer.h"
63 #include "content/public/browser/notification_service.h" 63 #include "content/public/browser/notification_service.h"
64 #include "content/public/browser/notification_types.h" 64 #include "content/public/browser/notification_types.h"
65 #include "content/public/browser/resource_dispatcher_host.h" 65 #include "content/public/browser/resource_dispatcher_host.h"
66 #include "content/public/common/browser_side_navigation_policy.h" 66 #include "content/public/common/browser_side_navigation_policy.h"
67 #include "content/public/common/content_features.h"
67 #include "content/public/common/content_switches.h" 68 #include "content/public/common/content_switches.h"
68 #include "content/public/common/url_constants.h" 69 #include "content/public/common/url_constants.h"
69 #include "content/public/test/browser_test_utils.h" 70 #include "content/public/test/browser_test_utils.h"
70 #include "content/public/test/content_browser_test_utils.h" 71 #include "content/public/test/content_browser_test_utils.h"
71 #include "content/public/test/navigation_handle_observer.h" 72 #include "content/public/test/navigation_handle_observer.h"
72 #include "content/public/test/test_frame_navigation_observer.h" 73 #include "content/public/test/test_frame_navigation_observer.h"
73 #include "content/public/test/test_navigation_observer.h" 74 #include "content/public/test/test_navigation_observer.h"
74 #include "content/public/test/test_utils.h" 75 #include "content/public/test/test_utils.h"
75 #include "content/shell/browser/shell.h" 76 #include "content/shell/browser/shell.h"
76 #include "content/test/content_browser_test_utils_internal.h" 77 #include "content/test/content_browser_test_utils_internal.h"
(...skipping 5607 matching lines...) Expand 10 before | Expand all | Expand 10 after
5684 SendMouseWheel(pos); 5685 SendMouseWheel(pos);
5685 5686
5686 // Expect both wheel and scroll handlers to fire. 5687 // Expect both wheel and scroll handlers to fire.
5687 EXPECT_TRUE(msg_queue.WaitForMessage(&reply)); 5688 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5688 EXPECT_EQ("\"wheel: 1\"", reply); 5689 EXPECT_EQ("\"wheel: 1\"", reply);
5689 EXPECT_TRUE(msg_queue.WaitForMessage(&reply)); 5690 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5690 EXPECT_EQ("\"scroll: 1\"", reply); 5691 EXPECT_EQ("\"scroll: 1\"", reply);
5691 5692
5692 SendMouseWheel(pos); 5693 SendMouseWheel(pos);
5693 5694
5694 // This time only the wheel handler fires, since it prevent defaults on 5695 // If async_wheel_events is disabled, this time only the wheel handler
5695 // even numbered scrolls. 5696 // fires, since even numbered scrolls are prevent-defaulted. If it is
5697 // enabled, then this wheel event will be sent non-blockingly and won't be
5698 // cancellable.
5696 EXPECT_TRUE(msg_queue.WaitForMessage(&reply)); 5699 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5697 EXPECT_EQ("\"wheel: 2\"", reply); 5700 EXPECT_EQ("\"wheel: 2\"", reply);
5701 if (base::FeatureList::IsEnabled(features::kAsyncWheelEvents)) {
5702 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5703 EXPECT_EQ("\"scroll: 2\"", reply);
5704 }
5698 5705
5699 SendMouseWheel(pos); 5706 SendMouseWheel(pos);
5700 5707
5701 // Odd number of wheels, expect both wheel and scroll handlers to fire 5708 // Odd number of wheels, expect both wheel and scroll handlers to fire
5702 // again. 5709 // again.
5703 EXPECT_TRUE(msg_queue.WaitForMessage(&reply)); 5710 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5704 EXPECT_EQ("\"wheel: 3\"", reply); 5711 EXPECT_EQ("\"wheel: 3\"", reply);
5705 EXPECT_TRUE(msg_queue.WaitForMessage(&reply)); 5712 EXPECT_TRUE(msg_queue.WaitForMessage(&reply));
5706 EXPECT_EQ("\"scroll: 3\"", reply); 5713 EXPECT_EQ("\"scroll: 3\"", reply);
5707 } 5714 }
(...skipping 4771 matching lines...) Expand 10 before | Expand all | Expand 10 after
10479 10486
10480 // The new tab's grandchild frame should reuse the b.com process. 10487 // The new tab's grandchild frame should reuse the b.com process.
10481 EXPECT_EQ(root->child_at(0)->current_frame_host()->GetProcess(), 10488 EXPECT_EQ(root->child_at(0)->current_frame_host()->GetProcess(),
10482 new_shell_root->child_at(0) 10489 new_shell_root->child_at(0)
10483 ->child_at(0) 10490 ->child_at(0)
10484 ->current_frame_host() 10491 ->current_frame_host()
10485 ->GetProcess()); 10492 ->GetProcess());
10486 } 10493 }
10487 10494
10488 } // namespace content 10495 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/pointer_lock_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698