Commit b9b95345 authored by nparker's avatar nparker Committed by Commit bot

Remove the Pver3 safe_browsing_test server and related bits.

It is both broken and deprecated. It'll be
sufficiently different for pver4 that we should start
from scratch.

BUG=612189,86092

Review-Url: https://codereview.chromium.org/2108313002
Cr-Commit-Position: refs/heads/master@{#403244}
parent 367c0f76
......@@ -414,7 +414,6 @@ vs-chromium-project.txt
/third_party/re2/src
/third_party/requests/src
/third_party/robolectric/lib
/third_party/safe_browsing/testing
/third_party/scons-2.0.1
/third_party/sfntly/src
/third_party/shaderc/src
......
......@@ -144,9 +144,6 @@ deps = {
'src/third_party/hunspell_dictionaries':
Var('chromium_git') + '/chromium/deps/hunspell_dictionaries.git' + '@' + 'dc6e7c25bf47cbfb466e0701fd2728b4a12e79d5',
'src/third_party/safe_browsing/testing':
Var('chromium_git') + '/external/google-safe-browsing/testing.git' + '@' + '9d7e8064f3ca2e45891470c9b5b1dce54af6a9d6',
'src/third_party/leveldatabase/src':
Var('chromium_git') + '/external/leveldb.git' + '@' + 'a7bff697baa062c8f6b8fb760eacf658712b611a',
......
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/browser/safe_browsing/local_safebrowsing_test_server.h"
#include "base/command_line.h"
#include "base/path_service.h"
#include "base/strings/string_number_conversions.h"
#include "base/values.h"
#include "chrome/common/chrome_paths.h"
#include "net/test/python_utils.h"
#include "net/test/spawned_test_server/spawned_test_server.h"
namespace safe_browsing {
LocalSafeBrowsingTestServer::LocalSafeBrowsingTestServer(
const base::FilePath& data_file)
: net::LocalTestServer(net::SpawnedTestServer::TYPE_HTTP,
net::SpawnedTestServer::kLocalhost,
base::FilePath()),
data_file_(data_file) {
}
LocalSafeBrowsingTestServer::~LocalSafeBrowsingTestServer() {}
bool LocalSafeBrowsingTestServer::GetTestServerPath(
base::FilePath* testserver_path) const {
base::FilePath testserver_dir;
if (!PathService::Get(chrome::DIR_TEST_DATA, &testserver_dir)) {
LOG(ERROR) << "Failed to get DIR_SOURCE_ROOT";
return false;
}
testserver_dir = testserver_dir
.Append(FILE_PATH_LITERAL("safe_browsing"));
*testserver_path = testserver_dir.Append(FILE_PATH_LITERAL(
"safe_browsing_testserver.py"));
return true;
}
bool LocalSafeBrowsingTestServer::SetPythonPath() const {
if (!net::LocalTestServer::SetPythonPath())
return false;
// Locate the Python code generated by the protocol buffers compiler.
base::FilePath pyproto_dir;
if (!GetPyProtoPath(&pyproto_dir)) {
LOG(ERROR) << "Cannot find pyproto dir for generated code.";
return false;
}
AppendToPythonPath(pyproto_dir.AppendASCII("google"));
return true;
}
bool LocalSafeBrowsingTestServer::GenerateAdditionalArguments(
base::DictionaryValue* arguments) const {
arguments->SetString("data-file", data_file_.value());
return true;
}
} // namespace safe_browsing
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_
#define CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_
#include "base/compiler_specific.h"
#include "base/files/file_path.h"
#include "base/macros.h"
#include "net/test/spawned_test_server/local_test_server.h"
namespace safe_browsing {
// Runs a Python-based safebrowsing test server on the same machine in which the
// LocalSafeBrowsingTestServer runs.
class LocalSafeBrowsingTestServer : public net::LocalTestServer {
public:
// Initialize a safebrowsing server using the given |data_file|.
explicit LocalSafeBrowsingTestServer(const base::FilePath& data_file);
~LocalSafeBrowsingTestServer() override;
bool SetPythonPath() const override;
// Returns the path to safe_browsing_testserver.py.
bool GetTestServerPath(base::FilePath* testserver_path) const override;
protected:
// Adds the --data-file switch. Returns true on success.
bool GenerateAdditionalArguments(
base::DictionaryValue* arguments) const override;
private:
base::FilePath data_file_;
DISALLOW_COPY_AND_ASSIGN(LocalSafeBrowsingTestServer);
};
} // namespace safe_browsing
#endif // CHROME_BROWSER_SAFE_BROWSING_LOCAL_SAFEBROWSING_TEST_SERVER_H_
This diff is collapsed.
......@@ -69,7 +69,6 @@
'../third_party/mocha/mocha.js',
'../third_party/pyftpdlib/',
'../third_party/pywebsocket/',
'../third_party/safe_browsing/',
'../third_party/simplejson/',
'../third_party/tlslite/',
'../ui/webui/resources/js/',
......
......@@ -884,10 +884,8 @@
'browser/speech/speech_recognition_browsertest.cc',
],
'chrome_browser_tests_full_safe_browsing_sources': [
'browser/safe_browsing/local_safebrowsing_test_server.cc',
'browser/safe_browsing/safe_browsing_blocking_page_test.cc',
'browser/safe_browsing/safe_browsing_service_browsertest.cc',
'browser/safe_browsing/safe_browsing_test.cc',
'renderer/safe_browsing/phishing_classifier_browsertest.cc',
'renderer/safe_browsing/phishing_classifier_delegate_browsertest.cc',
'renderer/safe_browsing/phishing_dom_feature_extractor_browsertest.cc',
......@@ -2214,7 +2212,6 @@
'../third_party/icu/icu.gyp:icuuc',
'../third_party/leveldatabase/leveldatabase.gyp:leveldatabase',
'../third_party/libaddressinput/libaddressinput.gyp:libaddressinput',
'../third_party/safe_browsing/safe_browsing.gyp:safe_browsing',
'../third_party/webrtc/modules/modules.gyp:desktop_capture',
'../third_party/widevine/cdm/widevine_cdm.gyp:widevine_cdm_version_h',
'../ui/accessibility/accessibility.gyp:accessibility_test_support',
......
......@@ -898,7 +898,6 @@ if (!is_android) {
"//third_party/mocha/mocha.js",
"//third_party/pyftpdlib/",
"//third_party/pywebsocket/",
"//third_party/safe_browsing/",
"//third_party/simplejson/",
"//third_party/tlslite/",
"//ui/webui/resources/js/",
......@@ -1012,7 +1011,6 @@ if (!is_android) {
"//third_party/icu",
"//third_party/leveldatabase",
"//third_party/libjingle",
"//third_party/safe_browsing:test_support",
"//third_party/webrtc/modules/desktop_capture",
"//third_party/widevine/cdm:version_h",
"//ui/accessibility:test_support",
......
#!/usr/bin/env python
# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Wraps the upstream safebrowsing_test_server.py to run in Chrome tests."""
import os
import sys
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
sys.path.append(os.path.join(BASE_DIR, '..', '..', '..', '..', 'net',
'tools', 'testserver'))
import testserver_base
class ServerRunner(testserver_base.TestServerRunner):
"""TestServerRunner for safebrowsing_test_server.py."""
def create_server(self, server_data):
sys.path.append(os.path.join(BASE_DIR, '..', '..', '..', '..',
'third_party', 'safe_browsing', 'testing'))
import safebrowsing_test_server
server = safebrowsing_test_server.SetupServer(
self.options.data_file, self.options.host, self.options.port,
opt_enforce_caching=False, opt_validate_database=True)
print 'Safebrowsing HTTP server started on port %d...' % server.server_port
server_data['port'] = server.server_port
return server
def add_options(self):
testserver_base.TestServerRunner.add_options(self)
self.option_parser.add_option('--data-file', dest='data_file',
help='File containing safebrowsing test '
'data and expectations')
if __name__ == '__main__':
sys.exit(ServerRunner().main())
......@@ -312,7 +312,6 @@ source_set("chrome_extensions_browsertests") {
"//third_party/leveldatabase",
"//third_party/libaddressinput",
"//third_party/libjingle",
"//third_party/safe_browsing:test_support",
"//third_party/webrtc/modules/desktop_capture",
"//third_party/widevine/cdm:version_h",
"//ui/accessibility:test_support",
......
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("test_support") {
testonly = true
data = [
"testing/external_test_pb2.py",
"testing/safebrowsing_test_server.py",
"testing/testing_input.dat",
]
}
Name: google-safe-browsing
URL: http://code.google.com/p/google-safe-browsing/
Version: unknown
License: Apache 2.0
License File: testing/LICENSE
Description:
This is the safebrowsing testing server that could be used to
verify the safebrowsing logic in chrome (and other browsers).
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
# GN version: //third_party/safe_browsing:test_support
'target_name': 'safe_browsing',
'type': 'none',
'sources': [
'testing/external_test_pb2.py',
'testing/safebrowsing_test_server.py',
'testing/testing_input.dat',
],
'export_dependent_settings': [
'../protobuf/protobuf.gyp:py_proto',
],
'dependencies': [
'../protobuf/protobuf.gyp:py_proto',
],
},
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment