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 "base/files/scoped_temp_dir.h" | 5 #include "base/files/scoped_temp_dir.h" |
6 #include "base/memory/ptr_util.h" | 6 #include "base/memory/ptr_util.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/run_loop.h" | 8 #include "base/run_loop.h" |
9 #include "base/test/test_simple_task_runner.h" | 9 #include "base/test/test_simple_task_runner.h" |
10 #include "components/safe_browsing_db/v4_database.h" | 10 #include "components/safe_browsing_db/v4_database.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 }; | 35 }; |
36 | 36 |
37 class V4LocalDatabaseManagerTest : public PlatformTest { | 37 class V4LocalDatabaseManagerTest : public PlatformTest { |
38 public: | 38 public: |
39 V4LocalDatabaseManagerTest() : task_runner_(new base::TestSimpleTaskRunner) {} | 39 V4LocalDatabaseManagerTest() : task_runner_(new base::TestSimpleTaskRunner) {} |
40 | 40 |
41 void SetUp() override { | 41 void SetUp() override { |
42 PlatformTest::SetUp(); | 42 PlatformTest::SetUp(); |
43 | 43 |
44 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); | 44 ASSERT_TRUE(base_dir_.CreateUniqueTempDir()); |
45 DVLOG(1) << "base_dir_: " << base_dir_.path().value(); | 45 DVLOG(1) << "base_dir_: " << base_dir_.GetPath().value(); |
46 | 46 |
47 v4_local_database_manager_ = | 47 v4_local_database_manager_ = |
48 make_scoped_refptr(new V4LocalDatabaseManager(base_dir_.path())); | 48 make_scoped_refptr(new V4LocalDatabaseManager(base_dir_.GetPath())); |
49 v4_local_database_manager_->SetTaskRunnerForTest(task_runner_); | 49 v4_local_database_manager_->SetTaskRunnerForTest(task_runner_); |
50 | 50 |
51 SetupLocalDatabaseManager(); | 51 SetupLocalDatabaseManager(); |
52 } | 52 } |
53 | 53 |
54 void TearDown() override { | 54 void TearDown() override { |
55 v4_local_database_manager_->StopOnIOThread(true); | 55 v4_local_database_manager_->StopOnIOThread(true); |
56 | 56 |
57 // Force destruction of the database. | 57 // Force destruction of the database. |
58 task_runner_->RunPendingTasks(); | 58 task_runner_->RunPendingTasks(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 | 130 |
131 // The same URL returns |false| in the previous test because | 131 // The same URL returns |false| in the previous test because |
132 // v4_local_database_manager_ is enabled. | 132 // v4_local_database_manager_ is enabled. |
133 ForceDisableLocalDatabaseManager(); | 133 ForceDisableLocalDatabaseManager(); |
134 | 134 |
135 EXPECT_TRUE(v4_local_database_manager_->CheckBrowseUrl( | 135 EXPECT_TRUE(v4_local_database_manager_->CheckBrowseUrl( |
136 GURL("http://example.com/a/"), nullptr)); | 136 GURL("http://example.com/a/"), nullptr)); |
137 } | 137 } |
138 | 138 |
139 } // namespace safe_browsing | 139 } // namespace safe_browsing |
OLD | NEW |