Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(990)

Side by Side Diff: chrome/browser/safe_browsing/client_side_detection_host_unittest.cc

Issue 1159553007: Move Tuple to base namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "base/files/file_path.h" 5 #include "base/files/file_path.h"
6 #include "base/memory/ref_counted.h" 6 #include "base/memory/ref_counted.h"
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 318
319 void ExpectShouldClassifyForMalwareResult(bool should_classify) { 319 void ExpectShouldClassifyForMalwareResult(bool should_classify) {
320 EXPECT_EQ(should_classify, csd_host_->should_classify_for_malware_); 320 EXPECT_EQ(should_classify, csd_host_->should_classify_for_malware_);
321 } 321 }
322 322
323 void ExpectStartPhishingDetection(const GURL* url) { 323 void ExpectStartPhishingDetection(const GURL* url) {
324 const IPC::Message* msg = process()->sink().GetFirstMessageMatching( 324 const IPC::Message* msg = process()->sink().GetFirstMessageMatching(
325 SafeBrowsingMsg_StartPhishingDetection::ID); 325 SafeBrowsingMsg_StartPhishingDetection::ID);
326 if (url) { 326 if (url) {
327 ASSERT_TRUE(msg); 327 ASSERT_TRUE(msg);
328 Tuple<GURL> actual_url; 328 base::Tuple<GURL> actual_url;
329 SafeBrowsingMsg_StartPhishingDetection::Read(msg, &actual_url); 329 SafeBrowsingMsg_StartPhishingDetection::Read(msg, &actual_url);
330 EXPECT_EQ(*url, get<0>(actual_url)); 330 EXPECT_EQ(*url, base::get<0>(actual_url));
331 EXPECT_EQ(rvh()->GetRoutingID(), msg->routing_id()); 331 EXPECT_EQ(rvh()->GetRoutingID(), msg->routing_id());
332 process()->sink().ClearMessages(); 332 process()->sink().ClearMessages();
333 } else { 333 } else {
334 ASSERT_FALSE(msg); 334 ASSERT_FALSE(msg);
335 } 335 }
336 } 336 }
337 337
338 void TestUnsafeResourceCopied(const UnsafeResource& resource) { 338 void TestUnsafeResourceCopied(const UnsafeResource& resource) {
339 ASSERT_TRUE(csd_host_->unsafe_resource_.get()); 339 ASSERT_TRUE(csd_host_->unsafe_resource_.get());
340 // Test that the resource from OnSafeBrowsingHit notification was copied 340 // Test that the resource from OnSafeBrowsingHit notification was copied
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
1138 EXPECT_EQ(url, resource.url); 1138 EXPECT_EQ(url, resource.url);
1139 EXPECT_EQ(url, resource.original_url); 1139 EXPECT_EQ(url, resource.original_url);
1140 1140
1141 ExpectStartPhishingDetection(NULL); 1141 ExpectStartPhishingDetection(NULL);
1142 1142
1143 // Showing a phishing warning will invalidate all the weak pointers which 1143 // Showing a phishing warning will invalidate all the weak pointers which
1144 // means we will not extract malware features. 1144 // means we will not extract malware features.
1145 ExpectShouldClassifyForMalwareResult(false); 1145 ExpectShouldClassifyForMalwareResult(false);
1146 } 1146 }
1147 } // namespace safe_browsing 1147 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698