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

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

Issue 7006005: Move UrlFetcher to content. I originally thought that it's only used by chrome code, but turns o... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/callback.h" 9 #include "base/callback.h"
10 #include "base/file_path.h" 10 #include "base/file_path.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/file_util_proxy.h" 12 #include "base/file_util_proxy.h"
13 #include "base/logging.h" 13 #include "base/logging.h"
14 #include "base/memory/scoped_ptr.h" 14 #include "base/memory/scoped_ptr.h"
15 #include "base/message_loop.h" 15 #include "base/message_loop.h"
16 #include "base/platform_file.h" 16 #include "base/platform_file.h"
17 #include "base/scoped_temp_dir.h" 17 #include "base/scoped_temp_dir.h"
18 #include "base/task.h" 18 #include "base/task.h"
19 #include "base/time.h" 19 #include "base/time.h"
20 #include "chrome/browser/safe_browsing/client_side_detection_service.h" 20 #include "chrome/browser/safe_browsing/client_side_detection_service.h"
21 #include "chrome/common/net/test_url_fetcher_factory.h"
22 #include "chrome/common/net/url_fetcher.h"
23 #include "chrome/common/safe_browsing/csd.pb.h" 21 #include "chrome/common/safe_browsing/csd.pb.h"
24 #include "content/browser/browser_thread.h" 22 #include "content/browser/browser_thread.h"
23 #include "content/common/test_url_fetcher_factory.h"
24 #include "content/common/url_fetcher.h"
25 #include "googleurl/src/gurl.h" 25 #include "googleurl/src/gurl.h"
26 #include "net/url_request/url_request_status.h" 26 #include "net/url_request/url_request_status.h"
27 #include "testing/gtest/include/gtest/gtest.h" 27 #include "testing/gtest/include/gtest/gtest.h"
28 28
29 namespace safe_browsing { 29 namespace safe_browsing {
30 30
31 class ClientSideDetectionServiceTest : public testing::Test { 31 class ClientSideDetectionServiceTest : public testing::Test {
32 protected: 32 protected:
33 virtual void SetUp() { 33 virtual void SetUp() {
34 file_thread_.reset(new BrowserThread(BrowserThread::FILE, &msg_loop_)); 34 file_thread_.reset(new BrowserThread(BrowserThread::FILE, &msg_loop_));
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("1.2.3.4")); 271 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("1.2.3.4"));
272 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("200.1.1.1")); 272 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("200.1.1.1"));
273 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("2001:0db8:ac10:fe01::")); 273 EXPECT_FALSE(csd_service_->IsPrivateIPAddress("2001:0db8:ac10:fe01::"));
274 274
275 // If the address can't be parsed, the default is true. 275 // If the address can't be parsed, the default is true.
276 EXPECT_TRUE(csd_service_->IsPrivateIPAddress("blah")); 276 EXPECT_TRUE(csd_service_->IsPrivateIPAddress("blah"));
277 } 277 }
278 278
279 } // namespace safe_browsing 279 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/client_side_detection_service.cc ('k') | chrome/browser/safe_browsing/malware_details_cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698