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

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

Issue 1420053005: Move code in components/safe_browsing_db and chrome/browser/s_b/ under the safe_browsing namespace. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_components_move
Patch Set: Other minor fixes incl. using "using safe_browsing::ClassName" instead of safe_browsing::ClassName everywhere. Created 5 years, 1 month 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/logging.h" 5 #include "base/logging.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/metrics/field_trial.h" 7 #include "base/metrics/field_trial.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/time/time.h" 9 #include "base/time/time.h"
10 #include "chrome/browser/safe_browsing/remote_database_manager.h" 10 #include "chrome/browser/safe_browsing/remote_database_manager.h"
11 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h" 11 #include "chrome/browser/safe_browsing/safe_browsing_api_handler.h"
12 #include "components/variations/variations_associated_data.h" 12 #include "components/variations/variations_associated_data.h"
13 #include "testing/gtest/include/gtest/gtest.h" 13 #include "testing/gtest/include/gtest/gtest.h"
14 14
15 namespace { 15 namespace safe_browsing {
16 16
17 class TestSafeBrowsingApiHandler : public SafeBrowsingApiHandler { 17 class TestSafeBrowsingApiHandler : public SafeBrowsingApiHandler {
18 public: 18 public:
19 void StartURLCheck(const URLCheckCallback& callback, 19 void StartURLCheck(const URLCheckCallback& callback,
20 const GURL& url, 20 const GURL& url,
21 const std::vector<SBThreatType>& threat_types) override {} 21 const std::vector<SBThreatType>& threat_types) override {}
22 }; 22 };
mattm 2015/11/11 01:10:16 keep in anon namespace
vakh (old account. dont use) 2015/11/11 18:59:53 Done.
23 23
24 class RemoteDatabaseManagerTest : public testing::Test { 24 class RemoteDatabaseManagerTest : public testing::Test {
25 protected: 25 protected:
26 RemoteDatabaseManagerTest() : field_trials_(new base::FieldTrialList(NULL)) {} 26 RemoteDatabaseManagerTest() : field_trials_(new base::FieldTrialList(NULL)) {}
27 27
28 void SetUp() override { 28 void SetUp() override {
29 SafeBrowsingApiHandler::SetInstance(&api_handler_); 29 SafeBrowsingApiHandler::SetInstance(&api_handler_);
30 db_ = new RemoteSafeBrowsingDatabaseManager(); 30 db_ = new RemoteSafeBrowsingDatabaseManager();
31 } 31 }
32 32
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 content::RESOURCE_TYPE_MAIN_FRAME)); // defaulted 88 content::RESOURCE_TYPE_MAIN_FRAME)); // defaulted
89 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_SUB_FRAME)); 89 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_SUB_FRAME));
90 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_STYLESHEET)); 90 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_STYLESHEET));
91 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_SCRIPT)); 91 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_SCRIPT));
92 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_IMAGE)); 92 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_IMAGE));
93 // ... 93 // ...
94 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_MEDIA)); 94 EXPECT_FALSE(db_->CanCheckResourceType(content::RESOURCE_TYPE_MEDIA));
95 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_WORKER)); 95 EXPECT_TRUE(db_->CanCheckResourceType(content::RESOURCE_TYPE_WORKER));
96 } 96 }
97 97
98 } // namespace 98 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698