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 "components/suggestions/suggestions_service.h" | 5 #include "components/suggestions/suggestions_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <sstream> | 8 #include <sstream> |
9 #include <string> | |
10 | 9 |
11 #include "base/bind.h" | 10 #include "base/bind.h" |
12 #include "base/memory/scoped_ptr.h" | 11 #include "base/memory/scoped_ptr.h" |
13 #include "base/message_loop/message_loop.h" | 12 #include "base/message_loop/message_loop.h" |
14 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
15 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
16 #include "components/suggestions/blacklist_store.h" | 15 #include "components/suggestions/blacklist_store.h" |
17 #include "components/suggestions/image_manager.h" | 16 #include "components/suggestions/image_manager.h" |
18 #include "components/suggestions/proto/suggestions.pb.h" | 17 #include "components/suggestions/proto/suggestions.pb.h" |
19 #include "components/suggestions/suggestions_store.h" | 18 #include "components/suggestions/suggestions_store.h" |
20 #include "components/suggestions/suggestions_utils.h" | 19 #include "components/suggestions/suggestions_utils.h" |
21 #include "components/variations/entropy_provider.h" | 20 #include "components/variations/entropy_provider.h" |
22 #include "components/variations/variations_associated_data.h" | 21 #include "components/variations/variations_associated_data.h" |
23 #include "net/http/http_response_headers.h" | 22 #include "net/http/http_response_headers.h" |
24 #include "net/http/http_status_code.h" | 23 #include "net/http/http_status_code.h" |
25 #include "net/url_request/test_url_fetcher_factory.h" | 24 #include "net/url_request/test_url_fetcher_factory.h" |
26 #include "net/url_request/url_request_status.h" | 25 #include "net/url_request/url_request_status.h" |
27 #include "net/url_request/url_request_test_util.h" | 26 #include "net/url_request/url_request_test_util.h" |
28 #include "testing/gmock/include/gmock/gmock.h" | 27 #include "testing/gmock/include/gmock/gmock.h" |
29 #include "testing/gtest/include/gtest/gtest.h" | 28 #include "testing/gtest/include/gtest/gtest.h" |
30 | 29 |
| 30 using std::string; |
31 using testing::DoAll; | 31 using testing::DoAll; |
32 using ::testing::Eq; | 32 using ::testing::Eq; |
33 using ::testing::Return; | 33 using ::testing::Return; |
34 using testing::SetArgPointee; | 34 using testing::SetArgPointee; |
35 using ::testing::NiceMock; | 35 using ::testing::NiceMock; |
36 using ::testing::StrictMock; | 36 using ::testing::StrictMock; |
37 using ::testing::_; | 37 using ::testing::_; |
38 | 38 |
39 namespace { | 39 namespace { |
40 | 40 |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
484 scoped_ptr<SuggestionsService> suggestions_service( | 484 scoped_ptr<SuggestionsService> suggestions_service( |
485 CreateSuggestionsServiceWithMocks()); | 485 CreateSuggestionsServiceWithMocks()); |
486 SuggestionsProfile suggestions = | 486 SuggestionsProfile suggestions = |
487 CreateSuggestionsProfileWithExpiryTimestamps(); | 487 CreateSuggestionsProfileWithExpiryTimestamps(); |
488 suggestions_service->SetDefaultExpiryTimestamp(&suggestions, | 488 suggestions_service->SetDefaultExpiryTimestamp(&suggestions, |
489 kTestDefaultExpiry); | 489 kTestDefaultExpiry); |
490 EXPECT_EQ(kTestSetExpiry, suggestions.suggestions(0).expiry_ts()); | 490 EXPECT_EQ(kTestSetExpiry, suggestions.suggestions(0).expiry_ts()); |
491 EXPECT_EQ(kTestDefaultExpiry, suggestions.suggestions(1).expiry_ts()); | 491 EXPECT_EQ(kTestDefaultExpiry, suggestions.suggestions(1).expiry_ts()); |
492 } | 492 } |
493 } // namespace suggestions | 493 } // namespace suggestions |
OLD | NEW |