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 <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 766 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
777 provider_.UpdateChromePolicy(policy); | 777 provider_.UpdateChromePolicy(policy); |
778 DCHECK(base::MessageLoop::current()); | 778 DCHECK(base::MessageLoop::current()); |
779 base::RunLoop loop; | 779 base::RunLoop loop; |
780 loop.RunUntilIdle(); | 780 loop.RunUntilIdle(); |
781 } | 781 } |
782 | 782 |
783 // Sends a mouse click at the given coordinates to the current renderer. | 783 // Sends a mouse click at the given coordinates to the current renderer. |
784 void PerformClick(int x, int y) { | 784 void PerformClick(int x, int y) { |
785 content::WebContents* contents = | 785 content::WebContents* contents = |
786 browser()->tab_strip_model()->GetActiveWebContents(); | 786 browser()->tab_strip_model()->GetActiveWebContents(); |
787 blink::WebMouseEvent click_event; | 787 blink::WebMouseEvent click_event(blink::WebInputEvent::MouseDown, |
788 click_event.type = blink::WebInputEvent::MouseDown; | 788 blink::WebInputEvent::NoModifiers, |
| 789 blink::WebInputEvent::TimeStampForTesting); |
789 click_event.button = blink::WebMouseEvent::Button::Left; | 790 click_event.button = blink::WebMouseEvent::Button::Left; |
790 click_event.clickCount = 1; | 791 click_event.clickCount = 1; |
791 click_event.x = x; | 792 click_event.x = x; |
792 click_event.y = y; | 793 click_event.y = y; |
793 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); | 794 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); |
794 click_event.type = blink::WebInputEvent::MouseUp; | 795 click_event.setType(blink::WebInputEvent::MouseUp); |
795 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); | 796 contents->GetRenderViewHost()->GetWidget()->ForwardMouseEvent(click_event); |
796 } | 797 } |
797 | 798 |
798 void SetPolicy(PolicyMap* policies, | 799 void SetPolicy(PolicyMap* policies, |
799 const char* key, | 800 const char* key, |
800 std::unique_ptr<base::Value> value) { | 801 std::unique_ptr<base::Value> value) { |
801 if (value) { | 802 if (value) { |
802 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, | 803 policies->Set(key, POLICY_LEVEL_MANDATORY, POLICY_SCOPE_USER, |
803 POLICY_SOURCE_CLOUD, std::move(value), nullptr); | 804 POLICY_SOURCE_CLOUD, std::move(value), nullptr); |
804 } else { | 805 } else { |
(...skipping 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4320 | 4321 |
4321 SetEmptyPolicy(); | 4322 SetEmptyPolicy(); |
4322 // Policy not set. | 4323 // Policy not set. |
4323 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); | 4324 CheckSystemTimezoneAutomaticDetectionPolicyUnset(); |
4324 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); | 4325 EXPECT_TRUE(CheckResolveTimezoneByGeolocation(true, false)); |
4325 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); | 4326 EXPECT_TRUE(manager->TimeZoneResolverShouldBeRunningForTests()); |
4326 } | 4327 } |
4327 #endif // defined(OS_CHROMEOS) | 4328 #endif // defined(OS_CHROMEOS) |
4328 | 4329 |
4329 } // namespace policy | 4330 } // namespace policy |
OLD | NEW |