OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "chrome/browser/policy/browser_policy_connector.h" | 10 #include "chrome/browser/policy/browser_policy_connector.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 // a power management policy with an empty |ac_delays| message but their | 40 // a power management policy with an empty |ac_delays| message but their |
41 // serializations are different. To simplify the equality check, ensure that | 41 // serializations are different. To simplify the equality check, ensure that |
42 // the expected and actual power management policies both have an |ac_delays| | 42 // the expected and actual power management policies both have an |ac_delays| |
43 // message. The same applies to the |battery_delays| message. | 43 // message. The same applies to the |battery_delays| message. |
44 pm::PowerManagementPolicy expected(expected_power_management_policy); | 44 pm::PowerManagementPolicy expected(expected_power_management_policy); |
45 expected.mutable_ac_delays(); | 45 expected.mutable_ac_delays(); |
46 expected.mutable_battery_delays(); | 46 expected.mutable_battery_delays(); |
47 pm::PowerManagementPolicy actual(arg); | 47 pm::PowerManagementPolicy actual(arg); |
48 actual.mutable_ac_delays(); | 48 actual.mutable_ac_delays(); |
49 actual.mutable_battery_delays(); | 49 actual.mutable_battery_delays(); |
| 50 actual.clear_reason(); |
50 return actual.SerializeAsString() == expected.SerializeAsString(); | 51 return actual.SerializeAsString() == expected.SerializeAsString(); |
51 } | 52 } |
52 | 53 |
53 } // namespace | 54 } // namespace |
54 | 55 |
55 class PowerPolicyBrowserTest : public InProcessBrowserTest { | 56 class PowerPolicyBrowserTest : public InProcessBrowserTest { |
56 protected: | 57 protected: |
57 // InProcessBrowserTest: | 58 // InProcessBrowserTest: |
58 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 59 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; |
59 | 60 |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 | 204 |
204 // During teardown, an empty power management policy should be sent to the | 205 // During teardown, an empty power management policy should be sent to the |
205 // backend. | 206 // backend. |
206 power_management_policy.Clear(); | 207 power_management_policy.Clear(); |
207 EXPECT_CALL(*power_manager_client_, SetPolicy( | 208 EXPECT_CALL(*power_manager_client_, SetPolicy( |
208 PowerManagementPolicyMatches(power_management_policy))); | 209 PowerManagementPolicyMatches(power_management_policy))); |
209 EXPECT_CALL(*power_manager_client_, RemoveObserver(_)).Times(AnyNumber()); | 210 EXPECT_CALL(*power_manager_client_, RemoveObserver(_)).Times(AnyNumber()); |
210 } | 211 } |
211 | 212 |
212 } // namespace policy | 213 } // namespace policy |
OLD | NEW |