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

Side by Side Diff: extensions/browser/api/power/power_api_unittest.cc

Issue 363993003: Move chrome.power API from chrome/ to extensions/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix quotes in gn file Created 6 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 | Annotate | Revision Log
« no previous file with comments | « extensions/browser/api/power/power_api_manager.cc ('k') | extensions/common/api/BUILD.gn » ('j') | 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) 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 "extensions/browser/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"
15 #include "chrome/browser/extensions/api/power/power_api_manager.h"
16 #include "chrome/browser/extensions/extension_function_test_utils.h" 14 #include "chrome/browser/extensions/extension_function_test_utils.h"
17 #include "chrome/test/base/browser_with_test_window_test.h" 15 #include "chrome/test/base/browser_with_test_window_test.h"
18 #include "content/public/browser/notification_details.h"
19 #include "content/public/browser/notification_source.h"
20 #include "content/public/browser/power_save_blocker.h" 16 #include "content/public/browser/power_save_blocker.h"
17 #include "extensions/browser/api/power/power_api_manager.h"
21 #include "extensions/common/extension.h" 18 #include "extensions/common/extension.h"
22 19
23 namespace utils = extension_function_test_utils; 20 namespace utils = extension_function_test_utils;
24 21
25 namespace extensions { 22 namespace extensions {
26 23
27 namespace { 24 namespace {
28 25
29 // Args commonly passed to PowerSaveBlockerStubManager::CallFunction(). 26 // Args commonly passed to PowerSaveBlockerStubManager::CallFunction().
30 const char kDisplayArgs[] = "[\"display\"]"; 27 const char kDisplayArgs[] = "[\"display\"]";
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 EXPECT_EQ(NONE, manager_->PopFirstRequest()); 279 EXPECT_EQ(NONE, manager_->PopFirstRequest());
283 280
284 // Make the first extension block display-sleep again. 281 // Make the first extension block display-sleep again.
285 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension_.get())); 282 ASSERT_TRUE(CallFunction(REQUEST, kDisplayArgs, extension_.get()));
286 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest()); 283 EXPECT_EQ(BLOCK_DISPLAY_SLEEP, manager_->PopFirstRequest());
287 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest()); 284 EXPECT_EQ(UNBLOCK_APP_SUSPENSION, manager_->PopFirstRequest());
288 EXPECT_EQ(NONE, manager_->PopFirstRequest()); 285 EXPECT_EQ(NONE, manager_->PopFirstRequest());
289 } 286 }
290 287
291 } // namespace extensions 288 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/api/power/power_api_manager.cc ('k') | extensions/common/api/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698