| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/search/suggestions/suggestions_store.h" | 5 #include "components/suggestions/suggestions_store.h" |
| 6 | 6 |
| 7 #include "chrome/browser/search/suggestions/proto/suggestions.pb.h" | 7 #include "components/pref_registry/testing_pref_service_syncable.h" |
| 8 #include "chrome/test/base/testing_pref_service_syncable.h" | 8 #include "components/suggestions/proto/suggestions.pb.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 using user_prefs::TestingPrefServiceSyncable; |
| 12 |
| 11 namespace suggestions { | 13 namespace suggestions { |
| 12 | 14 |
| 13 namespace { | 15 namespace { |
| 14 | 16 |
| 15 const char kTestTitle[] = "Foo site"; | 17 const char kTestTitle[] = "Foo site"; |
| 16 const char kTestUrl[] = "http://foo.com/"; | 18 const char kTestUrl[] = "http://foo.com/"; |
| 17 | 19 |
| 18 SuggestionsProfile CreateTestSuggestions() { | 20 SuggestionsProfile CreateTestSuggestions() { |
| 19 SuggestionsProfile suggestions; | 21 SuggestionsProfile suggestions; |
| 20 ChromeSuggestion* suggestion = suggestions.add_suggestions(); | 22 ChromeSuggestion* suggestion = suggestions.add_suggestions(); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 EXPECT_TRUE(suggestions_store.LoadSuggestions(&recovered_suggestions)); | 58 EXPECT_TRUE(suggestions_store.LoadSuggestions(&recovered_suggestions)); |
| 57 ValidateSuggestions(suggestions, recovered_suggestions); | 59 ValidateSuggestions(suggestions, recovered_suggestions); |
| 58 | 60 |
| 59 // Clear. | 61 // Clear. |
| 60 suggestions_store.ClearSuggestions(); | 62 suggestions_store.ClearSuggestions(); |
| 61 EXPECT_FALSE(suggestions_store.LoadSuggestions(&recovered_suggestions)); | 63 EXPECT_FALSE(suggestions_store.LoadSuggestions(&recovered_suggestions)); |
| 62 ValidateSuggestions(empty_suggestions, recovered_suggestions); | 64 ValidateSuggestions(empty_suggestions, recovered_suggestions); |
| 63 } | 65 } |
| 64 | 66 |
| 65 } // namespace suggestions | 67 } // namespace suggestions |
| OLD | NEW |