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

Side by Side Diff: chrome/browser/policy/policy_browsertest.cc

Issue 2569273002: Add constructors to WebInputEvents and setters so we can work at cleaning up these public structs. (Closed)
Patch Set: Fix mouse up event sender not modifying modifiers Created 4 years 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 provider_.UpdateChromePolicy(policy); 779 provider_.UpdateChromePolicy(policy);
780 DCHECK(base::MessageLoop::current()); 780 DCHECK(base::MessageLoop::current());
781 base::RunLoop loop; 781 base::RunLoop loop;
782 loop.RunUntilIdle(); 782 loop.RunUntilIdle();
783 } 783 }
784 784
785 // Sends a mouse click at the given coordinates to the current renderer. 785 // Sends a mouse click at the given coordinates to the current renderer.
786 void PerformClick(int x, int y) { 786 void PerformClick(int x, int y) {
787 content::WebContents* contents = 787 content::WebContents* contents =
788 browser()->tab_strip_model()->GetActiveWebContents(); 788 browser()->tab_strip_model()->GetActiveWebContents();
789 blink::WebMouseEvent click_event; 789 blink::WebMouseEvent click_event(blink::WebInputEvent::MouseDown,
790 click_event.type = blink::WebInputEvent::MouseDown; 790 blink::WebInputEvent::NoModifiers,
791 blink::WebInputEvent::TimeStampForTesting);
791 click_event.button = blink::WebMouseEvent::Button::Left; 792 click_event.button = blink::WebMouseEvent::Button::Left;
792 click_event.clickCount = 1; 793 click_event.clickCount = 1;
793 click_event.x = x; 794 click_event.x = x;
794 click_event.y = y; 795 click_event.y = y;
795 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); 796 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event);
796 click_event.type = blink::WebInputEvent::MouseUp; 797 click_event.setType(blink::WebInputEvent::MouseUp);
797 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); 798 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event);
798 } 799 }
799 800
800 void SetPolicy(PolicyMap* policies, 801 void SetPolicy(PolicyMap* policies,
801 const char* key, 802 const char* key,
802 std::unique_ptr<base::Value> value) { 803 std::unique_ptr<base::Value> value) {
803 if (value) { 804 if (value) {
804 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, 805 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER,
805 POLICY_SOURCE_CLOUD, std::move(value), nullptr); 806 POLICY_SOURCE_CLOUD, std::move(value), nullptr);
806 } else { 807 } else {
(...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after
4326 4327
4327 SetEmptyPolicy(); 4328 SetEmptyPolicy();
4328 // Policy not set. 4329 // Policy not set.
4329 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); 4330 CheckSystemTimezoneAutomaticDetectionPolicyUnset();
4330 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); 4331 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false));
4331 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); 4332 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests());
4332 } 4333 }
4333 #endif // defined(OS_CHROMEOS) 4334 #endif // defined(OS_CHROMEOS)
4334 4335
4335 } // namespace policy 4336 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698