| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/offline_pages/snapshot_controller.h" | 5 #include "components/offline_pages/snapshot_controller.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
| 9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
| 10 #include "base/test/test_mock_time_task_runner.h" | 10 #include "base/test/test_mock_time_task_runner.h" |
| 11 #include "base/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
| 12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
| 13 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 14 | 14 |
| 15 namespace offline_pages { | 15 namespace offline_pages { |
| 16 | 16 |
| 17 class SnapshotControllerTest | 17 class SnapshotControllerTest |
| 18 : public testing::Test, | 18 : public testing::Test, |
| 19 public SnapshotController::Client { | 19 public SnapshotController::Client { |
| 20 public: | 20 public: |
| 21 SnapshotControllerTest(); | 21 SnapshotControllerTest(); |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 | 155 |
| 156 controller()->Reset(); | 156 controller()->Reset(); |
| 157 controller()->DocumentAvailableInMainFrame(); | 157 controller()->DocumentAvailableInMainFrame(); |
| 158 FastForwardBy(base::TimeDelta::FromMilliseconds( | 158 FastForwardBy(base::TimeDelta::FromMilliseconds( |
| 159 controller()->GetDelayAfterDocumentAvailableForTest())); | 159 controller()->GetDelayAfterDocumentAvailableForTest())); |
| 160 // No snapshot since session was reset. | 160 // No snapshot since session was reset. |
| 161 EXPECT_EQ(2, snapshot_count()); | 161 EXPECT_EQ(2, snapshot_count()); |
| 162 } | 162 } |
| 163 | 163 |
| 164 } // namespace offline_pages | 164 } // namespace offline_pages |
| OLD | NEW |