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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/logging.h" | 6 #include "base/logging.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/frame_host/cross_site_transferring_request.h" | 8 #include "content/browser/frame_host/cross_site_transferring_request.h" |
9 #include "content/browser/frame_host/interstitial_page_impl.h" | 9 #include "content/browser/frame_host/interstitial_page_impl.h" |
10 #include "content/browser/frame_host/navigation_entry_impl.h" | 10 #include "content/browser/frame_host/navigation_entry_impl.h" |
(...skipping 2552 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2563 EXPECT_TRUE(view->is_occluded()); | 2563 EXPECT_TRUE(view->is_occluded()); |
2564 } | 2564 } |
2565 | 2565 |
2566 // Tests that GetLastActiveTime starts with a real, non-zero time and updates | 2566 // Tests that GetLastActiveTime starts with a real, non-zero time and updates |
2567 // on activity. | 2567 // on activity. |
2568 TEST_F(WebContentsImplTest, GetLastActiveTime) { | 2568 TEST_F(WebContentsImplTest, GetLastActiveTime) { |
2569 // The WebContents starts with a valid creation time. | 2569 // The WebContents starts with a valid creation time. |
2570 EXPECT_FALSE(contents()->GetLastActiveTime().is_null()); | 2570 EXPECT_FALSE(contents()->GetLastActiveTime().is_null()); |
2571 | 2571 |
2572 // Reset the last active time to a known-bad value. | 2572 // Reset the last active time to a known-bad value. |
2573 contents()->last_active_time_ = base::Time(); | 2573 contents()->last_active_time_ = base::TimeTicks(); |
2574 ASSERT_TRUE(contents()->GetLastActiveTime().is_null()); | 2574 ASSERT_TRUE(contents()->GetLastActiveTime().is_null()); |
2575 | 2575 |
2576 // Simulate activating the WebContents. The active time should update. | 2576 // Simulate activating the WebContents. The active time should update. |
2577 contents()->WasShown(); | 2577 contents()->WasShown(); |
2578 EXPECT_FALSE(contents()->GetLastActiveTime().is_null()); | 2578 EXPECT_FALSE(contents()->GetLastActiveTime().is_null()); |
2579 } | 2579 } |
2580 | 2580 |
2581 class ContentsZoomChangedDelegate : public WebContentsDelegate { | 2581 class ContentsZoomChangedDelegate : public WebContentsDelegate { |
2582 public: | 2582 public: |
2583 ContentsZoomChangedDelegate() : | 2583 ContentsZoomChangedDelegate() : |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3111 | 3111 |
3112 // Crash the renderer. | 3112 // Crash the renderer. |
3113 contents()->GetMainFrame()->GetProcess()->SimulateCrash(); | 3113 contents()->GetMainFrame()->GetProcess()->SimulateCrash(); |
3114 | 3114 |
3115 // Verify that all the power save blockers have been released. | 3115 // Verify that all the power save blockers have been released. |
3116 EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing()); | 3116 EXPECT_FALSE(contents()->has_video_power_save_blocker_for_testing()); |
3117 EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing()); | 3117 EXPECT_FALSE(contents()->has_audio_power_save_blocker_for_testing()); |
3118 } | 3118 } |
3119 | 3119 |
3120 } // namespace content | 3120 } // namespace content |
OLD | NEW |