| 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 // History unit tests come in two flavors: | 5 // History unit tests come in two flavors: |
| 6 // | 6 // |
| 7 // 1. The more complicated style is that the unit test creates a full history | 7 // 1. The more complicated style is that the unit test creates a full history |
| 8 // service. This spawns a background thread for the history backend, and | 8 // service. This spawns a background thread for the history backend, and |
| 9 // all communication is asynchronous. This is useful for testing more | 9 // all communication is asynchronous. This is useful for testing more |
| 10 // complicated things or end-to-end behavior. | 10 // complicated things or end-to-end behavior. |
| 11 // | 11 // |
| 12 // 2. The simpler style is to create a history backend on this thread and | 12 // 2. The simpler style is to create a history backend on this thread and |
| 13 // access it directly without a HistoryService object. This is much simpler | 13 // access it directly without a HistoryService object. This is much simpler |
| 14 // because communication is synchronous. Generally, sets should go through | 14 // because communication is synchronous. Generally, sets should go through |
| 15 // the history backend (since there is a lot of logic) but gets can come | 15 // the history backend (since there is a lot of logic) but gets can come |
| 16 // directly from the HistoryDatabase. This is because the backend generally | 16 // directly from the HistoryDatabase. This is because the backend generally |
| 17 // has no logic in the getter except threading stuff, which we don't want | 17 // has no logic in the getter except threading stuff, which we don't want |
| 18 // to run. | 18 // to run. |
| 19 | 19 |
| 20 #include "components/history/core/browser/history_backend.h" | 20 #include "components/history/core/browser/history_backend.h" |
| 21 | 21 |
| 22 #include <stddef.h> |
| 23 |
| 24 #include "base/macros.h" |
| 22 #include "components/history/core/test/history_backend_db_base_test.h" | 25 #include "components/history/core/test/history_backend_db_base_test.h" |
| 23 | 26 |
| 24 namespace history { | 27 namespace history { |
| 25 namespace { | 28 namespace { |
| 26 | 29 |
| 27 // This must be outside the anonymous namespace for the friend statement in | 30 // This must be outside the anonymous namespace for the friend statement in |
| 28 // HistoryBackend to work. | 31 // HistoryBackend to work. |
| 29 class ContentHistoryBackendDBTest : public HistoryBackendDBBaseTest { | 32 class ContentHistoryBackendDBTest : public HistoryBackendDBBaseTest { |
| 30 public: | 33 public: |
| 31 ContentHistoryBackendDBTest() {} | 34 ContentHistoryBackendDBTest() {} |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 } | 122 } |
| 120 | 123 |
| 121 EXPECT_TRUE(found) | 124 EXPECT_TRUE(found) |
| 122 << "Error \"" << cur_reason.name << "\" not found in historical list." | 125 << "Error \"" << cur_reason.name << "\" not found in historical list." |
| 123 << std::endl | 126 << std::endl |
| 124 << "Please add it."; | 127 << "Please add it."; |
| 125 } | 128 } |
| 126 } | 129 } |
| 127 } // namespace | 130 } // namespace |
| 128 } // namespace history | 131 } // namespace history |
| OLD | NEW |