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/background/initialize_store_task.h" | 5 #include "components/offline_pages/core/background/initialize_store_task.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
11 #include "base/threading/thread_task_runner_handle.h" | 11 #include "base/threading/thread_task_runner_handle.h" |
12 #include "components/offline_pages/background/request_queue_in_memory_store.h" | 12 #include "components/offline_pages/core/background/request_queue_in_memory_store
.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 using TestScenario = RequestQueueInMemoryStore::TestScenario; | 17 using TestScenario = RequestQueueInMemoryStore::TestScenario; |
18 | 18 |
19 class InitializeStoreTaskTest : public testing::Test { | 19 class InitializeStoreTaskTest : public testing::Test { |
20 public: | 20 public: |
21 InitializeStoreTaskTest(); | 21 InitializeStoreTaskTest(); |
22 ~InitializeStoreTaskTest() override; | 22 ~InitializeStoreTaskTest() override; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 &store, base::Bind(&InitializeStoreTaskTest::InitializeCallback, | 98 &store, base::Bind(&InitializeStoreTaskTest::InitializeCallback, |
99 base::Unretained(this))); | 99 base::Unretained(this))); |
100 task.Run(); | 100 task.Run(); |
101 PumpLoop(); | 101 PumpLoop(); |
102 EXPECT_TRUE(callback_called()); | 102 EXPECT_TRUE(callback_called()); |
103 EXPECT_FALSE(last_call_successful()); | 103 EXPECT_FALSE(last_call_successful()); |
104 EXPECT_EQ(StoreState::FAILED_RESET, store.state()); | 104 EXPECT_EQ(StoreState::FAILED_RESET, store.state()); |
105 } | 105 } |
106 | 106 |
107 } // namespace offline_pages | 107 } // namespace offline_pages |
OLD | NEW |