| 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 <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/pickle.h" | 8 #include "base/pickle.h" |
| 9 #include "base/run_loop.h" | 9 #include "base/run_loop.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 } // namespace. | 177 } // namespace. |
| 178 | 178 |
| 179 class MalwareDetailsTest : public ChromeRenderViewHostTestHarness { | 179 class MalwareDetailsTest : public ChromeRenderViewHostTestHarness { |
| 180 public: | 180 public: |
| 181 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; | 181 typedef SafeBrowsingUIManager::UnsafeResource UnsafeResource; |
| 182 | 182 |
| 183 MalwareDetailsTest() | 183 MalwareDetailsTest() |
| 184 : ui_manager_(new MockSafeBrowsingUIManager()) { | 184 : ui_manager_(new MockSafeBrowsingUIManager()) { |
| 185 } | 185 } |
| 186 | 186 |
| 187 virtual void SetUp() override { | 187 void SetUp() override { |
| 188 ChromeRenderViewHostTestHarness::SetUp(); | 188 ChromeRenderViewHostTestHarness::SetUp(); |
| 189 ASSERT_TRUE(profile()->CreateHistoryService( | 189 ASSERT_TRUE(profile()->CreateHistoryService( |
| 190 true /* delete_file */, false /* no_db */)); | 190 true /* delete_file */, false /* no_db */)); |
| 191 } | 191 } |
| 192 | 192 |
| 193 virtual void TearDown() override { | 193 void TearDown() override { |
| 194 profile()->DestroyHistoryService(); | 194 profile()->DestroyHistoryService(); |
| 195 ChromeRenderViewHostTestHarness::TearDown(); | 195 ChromeRenderViewHostTestHarness::TearDown(); |
| 196 } | 196 } |
| 197 | 197 |
| 198 static bool ResourceLessThan( | 198 static bool ResourceLessThan( |
| 199 const ClientMalwareReportRequest::Resource* lhs, | 199 const ClientMalwareReportRequest::Resource* lhs, |
| 200 const ClientMalwareReportRequest::Resource* rhs) { | 200 const ClientMalwareReportRequest::Resource* rhs) { |
| 201 return lhs->id() < rhs->id(); | 201 return lhs->id() < rhs->id(); |
| 202 } | 202 } |
| 203 | 203 |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 683 pb_resource = expected.add_resources(); | 683 pb_resource = expected.add_resources(); |
| 684 pb_resource->set_id(2); | 684 pb_resource->set_id(2); |
| 685 pb_resource->set_parent_id(3); | 685 pb_resource->set_parent_id(3); |
| 686 pb_resource->set_url(kSecondRedirectURL); | 686 pb_resource->set_url(kSecondRedirectURL); |
| 687 pb_resource = expected.add_resources(); | 687 pb_resource = expected.add_resources(); |
| 688 pb_resource->set_id(3); | 688 pb_resource->set_id(3); |
| 689 pb_resource->set_url(kFirstRedirectURL); | 689 pb_resource->set_url(kFirstRedirectURL); |
| 690 | 690 |
| 691 VerifyResults(actual, expected); | 691 VerifyResults(actual, expected); |
| 692 } | 692 } |
| OLD | NEW |