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 #include <map> | 5 #include <map> |
6 #include <queue> | 6 #include <queue> |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 using ::testing::Mock; | 31 using ::testing::Mock; |
32 using ::testing::StrictMock; | 32 using ::testing::StrictMock; |
33 using ::testing::_; | 33 using ::testing::_; |
34 using content::BrowserThread; | 34 using content::BrowserThread; |
35 | 35 |
36 namespace safe_browsing { | 36 namespace safe_browsing { |
37 namespace { | 37 namespace { |
38 | 38 |
39 class MockModelLoader : public ModelLoader { | 39 class MockModelLoader : public ModelLoader { |
40 public: | 40 public: |
41 explicit MockModelLoader(const std::string model_name) | 41 explicit MockModelLoader(const std::string& model_name) |
42 : ModelLoader(base::Closure(), model_name) {} | 42 : ModelLoader(base::Closure(), model_name) {} |
43 ~MockModelLoader() override {} | 43 ~MockModelLoader() override {} |
44 | 44 |
45 MOCK_METHOD1(ScheduleFetch, void(int64)); | 45 MOCK_METHOD1(ScheduleFetch, void(int64)); |
46 MOCK_METHOD0(CancelFetcher, void()); | 46 MOCK_METHOD0(CancelFetcher, void()); |
47 | 47 |
48 private: | 48 private: |
49 DISALLOW_COPY_AND_ASSIGN(MockModelLoader); | 49 DISALLOW_COPY_AND_ASSIGN(MockModelLoader); |
50 }; | 50 }; |
51 | 51 |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
477 | 477 |
478 // Check that disabling again doesn't request the model. | 478 // Check that disabling again doesn't request the model. |
479 csd_service_->SetEnabledAndRefreshState(false); | 479 csd_service_->SetEnabledAndRefreshState(false); |
480 // No calls expected. | 480 // No calls expected. |
481 msg_loop_.RunUntilIdle(); | 481 msg_loop_.RunUntilIdle(); |
482 Mock::VerifyAndClearExpectations(service); | 482 Mock::VerifyAndClearExpectations(service); |
483 Mock::VerifyAndClearExpectations(loader_1); | 483 Mock::VerifyAndClearExpectations(loader_1); |
484 Mock::VerifyAndClearExpectations(loader_2); | 484 Mock::VerifyAndClearExpectations(loader_2); |
485 } | 485 } |
486 } // namespace safe_browsing | 486 } // namespace safe_browsing |
OLD | NEW |