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

Side by Side Diff: content/browser/wake_lock/wake_lock_browsertest.cc

Issue 2126733002: Make ScreenWakeLock ContextLifecycleObserver instead of LocalFrameLifecycleObserver (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: temp Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "base/command_line.h" 5 #include "base/command_line.h"
6 #include "base/test/test_timeouts.h" 6 #include "base/test/test_timeouts.h"
7 #include "content/browser/wake_lock/wake_lock_service_context.h" 7 #include "content/browser/wake_lock/wake_lock_service_context.h"
8 #include "content/browser/web_contents/web_contents_impl.h" 8 #include "content/browser/web_contents/web_contents_impl.h"
9 #include "content/public/common/content_switches.h" 9 #include "content/public/common/content_switches.h"
10 #include "content/public/test/browser_test_utils.h" 10 #include "content/public/test/browser_test_utils.h"
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 259
260 NavigateToURL(shell(), test_in_page_url); 260 NavigateToURL(shell(), test_in_page_url);
261 EXPECT_TRUE(HasWakeLock()); 261 EXPECT_TRUE(HasWakeLock());
262 } 262 }
263 263
264 IN_PROC_BROWSER_TEST_F(WakeLockTest, UnlockAfterReload) { 264 IN_PROC_BROWSER_TEST_F(WakeLockTest, UnlockAfterReload) {
265 NavigateToURL(shell(), embedded_test_server()->GetURL("/simple_page.html")); 265 NavigateToURL(shell(), embedded_test_server()->GetURL("/simple_page.html"));
266 ScreenWakeLockInMainFrame(); 266 ScreenWakeLockInMainFrame();
267 267
268 shell()->Reload(); 268 shell()->Reload();
269 WaitForLoadStop(GetWebContents()); 269 WaitForPossibleUpdate();
270 270
271 // Screen wake lock should be released after reload. 271 // Screen wake lock should be released after reload.
272 EXPECT_FALSE(HasWakeLock()); 272 EXPECT_FALSE(HasWakeLock());
273 } 273 }
274 274
275 IN_PROC_BROWSER_TEST_F(WakeLockTest, BrowserInitiatedFrameNavigation) { 275 IN_PROC_BROWSER_TEST_F(WakeLockTest, BrowserInitiatedFrameNavigation) {
276 NavigateToURL(shell(), 276 NavigateToURL(shell(),
277 embedded_test_server()->GetURL("/frame_tree/2-4.html")); 277 embedded_test_server()->GetURL("/frame_tree/2-4.html"));
278 278
279 EXPECT_FALSE(HasWakeLock()); 279 EXPECT_FALSE(HasWakeLock());
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 GetNestedFrame()->GetProcess(), 367 GetNestedFrame()->GetProcess(),
368 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT); 368 RenderProcessHostWatcher::WATCH_FOR_PROCESS_EXIT);
369 GetNestedFrame()->GetProcess()->Shutdown(0, false); 369 GetNestedFrame()->GetProcess()->Shutdown(0, false);
370 watcher.Wait(); 370 watcher.Wait();
371 371
372 // Screen wake lock should be released. 372 // Screen wake lock should be released.
373 EXPECT_FALSE(HasWakeLock()); 373 EXPECT_FALSE(HasWakeLock());
374 } 374 }
375 375
376 } // namespace content 376 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698