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 "chrome/browser/extensions/api/power/power_api.h" | 5 #include "chrome/browser/extensions/api/power/power_api.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/memory/weak_ptr.h" | 13 #include "base/memory/weak_ptr.h" |
14 #include "chrome/browser/chrome_notification_types.h" | 14 #include "chrome/browser/chrome_notification_types.h" |
15 #include "chrome/browser/extensions/api/power/power_api_manager.h" | 15 #include "chrome/browser/extensions/api/power/power_api_manager.h" |
16 #include "chrome/browser/extensions/extension_function_test_utils.h" | 16 #include "chrome/browser/extensions/extension_function_test_utils.h" |
17 #include "chrome/common/extensions/extension.h" | |
18 #include "chrome/test/base/browser_with_test_window_test.h" | 17 #include "chrome/test/base/browser_with_test_window_test.h" |
19 #include "content/public/browser/notification_details.h" | 18 #include "content/public/browser/notification_details.h" |
20 #include "content/public/browser/notification_source.h" | 19 #include "content/public/browser/notification_source.h" |
21 #include "content/public/browser/power_save_blocker.h" | 20 #include "content/public/browser/power_save_blocker.h" |
| 21 #include "extensions/common/extension.h" |
22 | 22 |
23 namespace utils = extension_function_test_utils; | 23 namespace utils = extension_function_test_utils; |
24 | 24 |
25 namespace extensions { | 25 namespace extensions { |
26 | 26 |
27 namespace { | 27 namespace { |
28 | 28 |
29 // Args commonly passed to PowerSaveBlockerStubManager::CallFunction(). | 29 // Args commonly passed to PowerSaveBlockerStubManager::CallFunction(). |
30 const char kDisplayArgs[] = "[\"display\"]"; | 30 const char kDisplayArgs[] = "[\"display\"]"; |
31 const char kSystemArgs[] = "[\"system\"]"; | 31 const char kSystemArgs[] = "[\"system\"]"; |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 EXPECT_EQ(NONE, manager_->PopFirstRequest()); | 276 EXPECT_EQ(NONE, manager_->PopFirstRequest()); |
277 | 277 |
278 // Make the first extension block display-sleep again. | 278 // Make the first extension block display-sleep again. |
279 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension_.get())); | 279 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension_.get())); |
280 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); | 280 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); |
281 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); | 281 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); |
282 EXPECT_EQ(NONE, manager_->PopFirstRequest()); | 282 EXPECT_EQ(NONE, manager_->PopFirstRequest()); |
283 } | 283 } |
284 | 284 |
285 } // namespace extensions | 285 } // namespace extensions |
OLD | NEW |