diff options
author | Bo Liu <boliu@google.com> | 2014-05-01 10:37:37 -0700 |
---|---|---|
committer | Bo Liu <boliu@google.com> | 2014-05-01 10:37:37 -0700 |
commit | 5c02ac1a9c1b504631c0a3d2b6e737b5d738bae1 (patch) | |
tree | 5df224c921d52ab02739b38e2149652208b023e6 /chrome/test | |
parent | 56e9d6e218656f3d05620cc9877fd61482337fb1 (diff) | |
download | chromium_org-5c02ac1a9c1b504631c0a3d2b6e737b5d738bae1.tar.gz |
Merge from Chromium at DEPS revision 267519
This commit was generated by merge_to_master.py.
Change-Id: I6002987b71e09742c68bad9c834ae800ff531f25
Diffstat (limited to 'chrome/test')
20 files changed, 177 insertions, 92 deletions
diff --git a/chrome/test/base/browser_with_test_window_test.cc b/chrome/test/base/browser_with_test_window_test.cc index c45f7fa709..e5de4b2a3b 100644 --- a/chrome/test/base/browser_with_test_window_test.cc +++ b/chrome/test/base/browser_with_test_window_test.cc @@ -20,6 +20,7 @@ #if defined(USE_AURA) #include "ui/aura/test/aura_test_helper.h" #include "ui/compositor/test/context_factories_for_test.h" +#include "ui/wm/core/default_activation_client.h" #endif #if defined(USE_ASH) @@ -70,6 +71,7 @@ void BrowserWithTestWindowTest::SetUp() { aura_test_helper_.reset(new aura::test::AuraTestHelper( base::MessageLoopForUI::current())); aura_test_helper_->SetUp(); + new wm::DefaultActivationClient(aura_test_helper_->root_window()); #endif // USE_AURA #if defined(TOOLKIT_VIEWS) views_delegate_.reset(CreateViewsDelegate()); diff --git a/chrome/test/base/chrome_render_view_test.cc b/chrome/test/base/chrome_render_view_test.cc index 732e2f1d41..a1ddd2fb73 100644 --- a/chrome/test/base/chrome_render_view_test.cc +++ b/chrome/test/base/chrome_render_view_test.cc @@ -41,7 +41,11 @@ using autofill::AutofillAgent; using autofill::PasswordAutofillAgent; using autofill::PasswordGenerationAgent; -ChromeRenderViewTest::ChromeRenderViewTest() : extension_dispatcher_(NULL) { +ChromeRenderViewTest::ChromeRenderViewTest() + : password_autofill_(NULL), + password_generation_(NULL), + autofill_agent_(NULL), + chrome_render_thread_(NULL) { } ChromeRenderViewTest::~ChromeRenderViewTest() { @@ -54,8 +58,6 @@ void ChromeRenderViewTest::SetUp() { chrome_render_thread_ = new ChromeMockRenderThread(); render_thread_.reset(chrome_render_thread_); - extension_dispatcher_ = new extensions::Dispatcher(); - content::RenderViewTest::SetUp(); // RenderView doesn't expose its Agent objects, because it has no need to @@ -68,8 +70,9 @@ void ChromeRenderViewTest::SetUp() { } void ChromeRenderViewTest::TearDown() { - extension_dispatcher_->OnRenderProcessShutdown(); - extension_dispatcher_ = NULL; + ChromeContentRendererClient* client = + static_cast<ChromeContentRendererClient*>(content_renderer_client_.get()); + client->GetExtensionDispatcherForTest()->OnRenderProcessShutdown(); #if defined(LEAK_SANITIZER) // Do this before shutting down V8 in RenderViewTest::TearDown(). @@ -91,7 +94,7 @@ content::ContentBrowserClient* content::ContentRendererClient* ChromeRenderViewTest::CreateContentRendererClient() { ChromeContentRendererClient* client = new ChromeContentRendererClient(); - client->SetExtensionDispatcher(extension_dispatcher_); + client->SetExtensionDispatcherForTest(new extensions::Dispatcher); #if defined(ENABLE_SPELLCHECK) client->SetSpellcheck(new SpellCheck()); #endif diff --git a/chrome/test/base/chrome_render_view_test.h b/chrome/test/base/chrome_render_view_test.h index 69bd244d76..5c4824f2cd 100644 --- a/chrome/test/base/chrome_render_view_test.h +++ b/chrome/test/base/chrome_render_view_test.h @@ -16,10 +16,6 @@ class TestPasswordAutofillAgent; class TestPasswordGenerationAgent; } -namespace extensions { -class Dispatcher; -} - class ChromeRenderViewTest : public content::RenderViewTest { public: ChromeRenderViewTest(); @@ -34,8 +30,6 @@ class ChromeRenderViewTest : public content::RenderViewTest { virtual content::ContentRendererClient* CreateContentRendererClient() OVERRIDE; - extensions::Dispatcher* extension_dispatcher_; - autofill::TestPasswordAutofillAgent* password_autofill_; autofill::TestPasswordGenerationAgent* password_generation_; autofill::AutofillAgent* autofill_agent_; diff --git a/chrome/test/base/in_process_browser_test.cc b/chrome/test/base/in_process_browser_test.cc index b8b3efd385..5b8c7c7753 100644 --- a/chrome/test/base/in_process_browser_test.cc +++ b/chrome/test/base/in_process_browser_test.cc @@ -178,8 +178,8 @@ void InProcessBrowserTest::SetUp() { #endif #if defined(ENABLE_CAPTIVE_PORTAL_DETECTION) - captive_portal::CaptivePortalService::set_state_for_testing( - captive_portal::CaptivePortalService::DISABLED_FOR_TESTING); + CaptivePortalService::set_state_for_testing( + CaptivePortalService::DISABLED_FOR_TESTING); #endif chrome_browser_net::NetErrorTabHelper::set_state_for_testing( diff --git a/chrome/test/base/testing_profile.cc b/chrome/test/base/testing_profile.cc index 48898087d2..5c423d265c 100644 --- a/chrome/test/base/testing_profile.cc +++ b/chrome/test/base/testing_profile.cc @@ -15,8 +15,8 @@ #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" #include "chrome/browser/autocomplete/autocomplete_classifier.h" -#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" +#include "chrome/browser/bookmarks/chrome_bookmark_client.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/content_settings/host_content_settings_map.h" @@ -56,6 +56,7 @@ #include "chrome/test/base/history_index_restore_observer.h" #include "chrome/test/base/testing_pref_service_syncable.h" #include "chrome/test/base/ui_test_utils.h" +#include "components/bookmarks/core/browser/bookmark_model.h" #include "components/bookmarks/core/common/bookmark_constants.h" #include "components/keyed_service/content/browser_context_dependency_manager.h" #include "components/policy/core/common/policy_service.h" @@ -494,9 +495,16 @@ void TestingProfile::DestroyTopSites() { static KeyedService* BuildBookmarkModel(content::BrowserContext* context) { Profile* profile = static_cast<Profile*>(context); - BookmarkModel* bookmark_model = new BookmarkModel(profile, false); - bookmark_model->Load(profile->GetIOTaskRunner()); - return bookmark_model; + ChromeBookmarkClient* bookmark_client = + new ChromeBookmarkClient(profile, false); + bookmark_client->model()->Load( + profile->GetPrefs(), + profile->GetPrefs()->GetString(prefs::kAcceptLanguages), + profile->GetPath(), + profile->GetIOTaskRunner(), + content::BrowserThread::GetMessageLoopProxyForThread( + content::BrowserThread::UI)); + return bookmark_client; } void TestingProfile::CreateBookmarkModel(bool delete_file) { @@ -505,9 +513,10 @@ void TestingProfile::CreateBookmarkModel(bool delete_file) { base::DeleteFile(path, false); } // This will create a bookmark model. - BookmarkModel* bookmark_service = static_cast<BookmarkModel*>( - BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse( - this, BuildBookmarkModel)); + BookmarkModel* bookmark_service = + static_cast<ChromeBookmarkClient*>( + BookmarkModelFactory::GetInstance()->SetTestingFactoryAndUse( + this, BuildBookmarkModel))->model(); HistoryService* history_service = HistoryServiceFactory::GetForProfileWithoutCreating(this); diff --git a/chrome/test/base/ui_test_utils.cc b/chrome/test/base/ui_test_utils.cc index 3ca5ff41d9..39ab299e16 100644 --- a/chrome/test/base/ui_test_utils.cc +++ b/chrome/test/base/ui_test_utils.cc @@ -25,7 +25,6 @@ #include "base/time/time.h" #include "base/values.h" #include "chrome/browser/autocomplete/autocomplete_controller.h" -#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/bookmarks/bookmark_model_factory.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chrome_notification_types.h" @@ -53,6 +52,7 @@ #include "chrome/common/chrome_paths.h" #include "chrome/common/pref_names.h" #include "chrome/test/base/find_in_page_observer.h" +#include "components/bookmarks/core/browser/bookmark_model.h" #include "content/public/browser/dom_operation_notification_details.h" #include "content/public/browser/download_item.h" #include "content/public/browser/download_manager.h" diff --git a/chrome/test/base/view_event_test_base.cc b/chrome/test/base/view_event_test_base.cc index d8604c94b4..aae31d9730 100644 --- a/chrome/test/base/view_event_test_base.cc +++ b/chrome/test/base/view_event_test_base.cc @@ -12,12 +12,20 @@ #include "chrome/test/base/interactive_test_utils.h" #include "chrome/test/base/testing_browser_process.h" #include "chrome/test/base/ui_test_utils.h" +#include "ui/aura/client/event_client.h" +#include "ui/aura/env.h" +#include "ui/aura/test/aura_test_helper.h" +#include "ui/aura/window_event_dispatcher.h" +#include "ui/aura/window_tree_host.h" #include "ui/base/ime/input_method_initializer.h" #include "ui/base/test/ui_controls.h" #include "ui/compositor/test/context_factories_for_test.h" +#include "ui/compositor/test/context_factories_for_test.h" #include "ui/message_center/message_center.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" +#include "ui/wm/core/default_activation_client.h" +#include "ui/wm/core/wm_state.h" #if defined(USE_ASH) #include "ash/shell.h" @@ -25,16 +33,6 @@ #include "ash/test/test_shell_delegate.h" #endif -#if defined(USE_AURA) -#include "ui/aura/client/event_client.h" -#include "ui/aura/env.h" -#include "ui/aura/test/aura_test_helper.h" -#include "ui/aura/window_event_dispatcher.h" -#include "ui/aura/window_tree_host.h" -#include "ui/compositor/test/context_factories_for_test.h" -#include "ui/wm/core/wm_state.h" -#endif - #if defined(OS_CHROMEOS) #include "chromeos/audio/cras_audio_handler.h" #include "chromeos/dbus/dbus_thread_manager.h" @@ -102,19 +100,15 @@ void ViewEventTestBase::SetUpTestCase() { } void ViewEventTestBase::SetUp() { -#if defined(USE_AURA) wm_state_.reset(new wm::WMState); -#endif views::ViewsDelegate::views_delegate = &views_delegate_; ui::InitializeInputMethodForTesting(); gfx::NativeView context = NULL; -#if defined(USE_AURA) // The ContextFactory must exist before any Compositors are created. bool enable_pixel_output = false; ui::InitializeContextFactoryForTests(enable_pixel_output); -#endif #if defined(USE_ASH) #if defined(OS_WIN) @@ -147,6 +141,7 @@ void ViewEventTestBase::SetUp() { aura_test_helper_.reset( new aura::test::AuraTestHelper(base::MessageLoopForUI::current())); aura_test_helper_->SetUp(); + new wm::DefaultActivationClient(aura_test_helper_->root_window()); context = aura_test_helper_->root_window(); #endif // !USE_ASH && USE_AURA @@ -179,16 +174,12 @@ void ViewEventTestBase::TearDown() { aura_test_helper_->TearDown(); #endif // !USE_ASH && USE_AURA -#if defined(USE_AURA) ui::TerminateContextFactoryForTests(); -#endif ui::ShutdownInputMethodForTesting(); views::ViewsDelegate::views_delegate = NULL; -#if defined(USE_AURA) wm_state_.reset(); -#endif } bool ViewEventTestBase::CanResize() const { diff --git a/chrome/test/chromedriver/VERSION b/chrome/test/chromedriver/VERSION index 8c2691509e..37989bd16b 100644 --- a/chrome/test/chromedriver/VERSION +++ b/chrome/test/chromedriver/VERSION @@ -1 +1 @@ -2.9 +2.10 diff --git a/chrome/test/chromedriver/archive.py b/chrome/test/chromedriver/archive.py index 29e3982c95..8b8ca6cc50 100644 --- a/chrome/test/chromedriver/archive.py +++ b/chrome/test/chromedriver/archive.py @@ -10,9 +10,9 @@ import urllib import util -CHROME_32_REVISION = '232870' CHROME_33_REVISION = '241075' CHROME_34_REVISION = '251854' +CHROME_35_REVISION = '260135' _SITE = 'http://commondatastorage.googleapis.com' diff --git a/chrome/test/chromedriver/chrome/version.cc b/chrome/test/chromedriver/chrome/version.cc index 44ec6cc3b1..06ba74218b 100644 --- a/chrome/test/chromedriver/chrome/version.cc +++ b/chrome/test/chromedriver/chrome/version.cc @@ -9,7 +9,7 @@ namespace { // This variable must be able to be found and parsed by the upload script. -const int kMinimumSupportedChromeVersion[] = {32, 0, 1700, 0}; +const int kMinimumSupportedChromeVersion[] = {33, 0, 1751, 0}; } // namespace diff --git a/chrome/test/chromedriver/run_buildbot_steps.py b/chrome/test/chromedriver/run_buildbot_steps.py index 05390f1edf..c6c2c7cf21 100755 --- a/chrome/test/chromedriver/run_buildbot_steps.py +++ b/chrome/test/chromedriver/run_buildbot_steps.py @@ -274,8 +274,18 @@ def _Release(build, version, platform): """Releases the given candidate build.""" release_name = 'chromedriver_%s.zip' % platform util.MarkBuildStepStart('releasing %s' % release_name) + temp_dir = util.MakeTempDir() + slave_utils.GSUtilCopy(build, temp_dir) + zip_path = os.path.join(temp_dir, os.path.basename(build)) + + if util.IsLinux(): + util.Unzip(zip_path, temp_dir) + server_path = os.path.join(temp_dir, 'chromedriver') + util.RunCommand(['strip', server_path]) + zip_path = util.Zip(server_path) + slave_utils.GSUtilCopy( - build, '%s/%s/%s' % (GS_CHROMEDRIVER_BUCKET, version, release_name)) + zip_path, '%s/%s/%s' % (GS_CHROMEDRIVER_BUCKET, version, release_name)) _MaybeUploadReleaseNotes(version) _MaybeUpdateLatestRelease(version) diff --git a/chrome/test/chromedriver/server/chromedriver_server.cc b/chrome/test/chromedriver/server/chromedriver_server.cc index 360eac46a3..2bc95c9363 100644 --- a/chrome/test/chromedriver/server/chromedriver_server.cc +++ b/chrome/test/chromedriver/server/chromedriver_server.cc @@ -18,6 +18,7 @@ #include "base/message_loop/message_loop.h" #include "base/run_loop.h" #include "base/strings/string_number_conversions.h" +#include "base/strings/string_split.h" #include "base/strings/string_util.h" #include "base/strings/stringprintf.h" #include "base/synchronization/waitable_event.h" @@ -36,6 +37,8 @@ namespace { +const char* kLocalHostAddress = "127.0.0.1"; + typedef base::Callback< void(const net::HttpServerRequestInfo&, const HttpResponseSenderFunc&)> HttpRequestHandlerFunc; @@ -48,9 +51,12 @@ class HttpServer : public net::HttpServer::Delegate { virtual ~HttpServer() {} - bool Start(int port) { + bool Start(int port, bool allow_remote) { + std::string binding_ip = kLocalHostAddress; + if (allow_remote) + binding_ip = "0.0.0.0"; server_ = new net::HttpServer( - net::TCPListenSocketFactory("0.0.0.0", port), this); + net::TCPListenSocketFactory(binding_ip, port), this); net::IPEndPoint address; return server_->GetLocalAddress(&address) == net::OK; } @@ -97,8 +103,23 @@ void SendResponseOnCmdThread( void HandleRequestOnCmdThread( HttpHandler* handler, + const std::vector<std::string>& whitelisted_ips, const net::HttpServerRequestInfo& request, const HttpResponseSenderFunc& send_response_func) { + if (!whitelisted_ips.empty()) { + std::string peer_address = request.peer.ToStringWithoutPort(); + if (peer_address != kLocalHostAddress && + std::find(whitelisted_ips.begin(), whitelisted_ips.end(), + peer_address) == whitelisted_ips.end()) { + LOG(WARNING) << "unauthorized access from " << request.peer.ToString(); + scoped_ptr<net::HttpServerResponseInfo> response( + new net::HttpServerResponseInfo(net::HTTP_UNAUTHORIZED)); + response->SetBody("Unauthorized access", "text/plain"); + send_response_func.Run(response.Pass()); + return; + } + } + handler->Handle(request, send_response_func); } @@ -127,9 +148,10 @@ void StopServerOnIOThread() { } void StartServerOnIOThread(int port, + bool allow_remote, const HttpRequestHandlerFunc& handle_request_func) { scoped_ptr<HttpServer> temp_server(new HttpServer(handle_request_func)); - if (!temp_server->Start(port)) { + if (!temp_server->Start(port, allow_remote)) { printf("Port not available. Exiting...\n"); exit(1); } @@ -137,6 +159,8 @@ void StartServerOnIOThread(int port, } void RunServer(int port, + bool allow_remote, + const std::vector<std::string>& whitelisted_ips, const std::string& url_base, int adb_port, scoped_ptr<PortServer> port_server) { @@ -152,12 +176,13 @@ void RunServer(int port, adb_port, port_server.Pass()); HttpRequestHandlerFunc handle_request_func = - base::Bind(&HandleRequestOnCmdThread, &handler); + base::Bind(&HandleRequestOnCmdThread, &handler, whitelisted_ips); io_thread.message_loop() ->PostTask(FROM_HERE, base::Bind(&StartServerOnIOThread, port, + allow_remote, base::Bind(&HandleRequestOnIOThread, cmd_loop.message_loop_proxy(), handle_request_func))); @@ -189,6 +214,8 @@ int main(int argc, char *argv[]) { // Parse command line flags. int port = 9515; int adb_port = 5037; + bool allow_remote = false; + std::vector<std::string> whitelisted_ips; std::string url_base; scoped_ptr<PortServer> port_server; if (cmd_line->HasSwitch("h") || cmd_line->HasSwitch("help")) { @@ -203,6 +230,8 @@ int main(int argc, char *argv[]) { "silent", "log nothing", "url-base", "base URL path prefix for commands, e.g. wd/url", "port-server", "address of server to contact for reserving a port", + "whitelisted-ips", "comma-separated whitelist of remote IPv4 addresses " + "which are allowed to connect to ChromeDriver", }; for (size_t i = 0; i < arraysize(kOptionAndDescriptions) - 1; i += 2) { options += base::StringPrintf( @@ -251,9 +280,22 @@ int main(int argc, char *argv[]) { url_base = "/" + url_base; if (url_base[url_base.length() - 1] != '/') url_base = url_base + "/"; + if (cmd_line->HasSwitch("whitelisted-ips")) { + allow_remote = true; + std::string whitelist = cmd_line->GetSwitchValueASCII("whitelisted-ips"); + base::SplitString(whitelist, ',', &whitelisted_ips); + } if (!cmd_line->HasSwitch("silent")) { printf( "Starting ChromeDriver (v%s) on port %d\n", kChromeDriverVersion, port); + if (!allow_remote) { + printf("Only local connections are allowed.\n"); + } else if (!whitelisted_ips.empty()) { + printf("Remote connections are allowed by a whitelist (%s).\n", + cmd_line->GetSwitchValueASCII("whitelisted-ips").c_str()); + } else { + printf("All remote connections are allowed. Use a whitelist instead!\n"); + } fflush(stdout); } @@ -261,6 +303,7 @@ int main(int argc, char *argv[]) { printf("Unable to initialize logging. Exiting...\n"); return 1; } - RunServer(port, url_base, adb_port, port_server.Pass()); + RunServer(port, allow_remote, whitelisted_ips, + url_base, adb_port, port_server.Pass()); return 0; } diff --git a/chrome/test/chromedriver/test/run_all_tests.py b/chrome/test/chromedriver/test/run_all_tests.py index 434bf118ef..078f214f26 100755 --- a/chrome/test/chromedriver/test/run_all_tests.py +++ b/chrome/test/chromedriver/test/run_all_tests.py @@ -191,9 +191,9 @@ def main(): latest_snapshot_revision = archive.GetLatestRevision(archive.Site.SNAPSHOT) versions = [ ['HEAD', latest_snapshot_revision], + ['35', archive.CHROME_35_REVISION], ['34', archive.CHROME_34_REVISION], - ['33', archive.CHROME_33_REVISION], - ['32', archive.CHROME_32_REVISION] + ['33', archive.CHROME_33_REVISION] ] code = 0 for version in versions: diff --git a/chrome/test/chromedriver/test/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index 0e14f116b5..d5ee27e9be 100755 --- a/chrome/test/chromedriver/test/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py @@ -40,6 +40,7 @@ if util.IsLinux(): from pylib import constants from pylib import forwarder from pylib import valgrind_tools + from pylib.device import device_utils _NEGATIVE_FILTER = [ @@ -179,18 +180,18 @@ class ChromeDriverTest(ChromeDriverBaseTest): chrome_paths.GetTestData()) ChromeDriverTest._sync_server = webserver.SyncWebServer() if _ANDROID_PACKAGE_KEY: - ChromeDriverTest._adb = android_commands.AndroidCommands( + ChromeDriverTest._device = device_utils.DeviceUtils( android_commands.GetAttachedDevices()[0]) http_host_port = ChromeDriverTest._http_server._server.server_port sync_host_port = ChromeDriverTest._sync_server._server.server_port forwarder.Forwarder.Map( [(http_host_port, http_host_port), (sync_host_port, sync_host_port)], - ChromeDriverTest._adb) + ChromeDriverTest._device) @staticmethod def GlobalTearDown(): if _ANDROID_PACKAGE_KEY: - forwarder.Forwarder.UnmapAllDevicePorts(ChromeDriverTest._adb) + forwarder.Forwarder.UnmapAllDevicePorts(ChromeDriverTest._device) ChromeDriverTest._http_server.Shutdown() @staticmethod diff --git a/chrome/test/chromedriver/test/test_environment.py b/chrome/test/chromedriver/test/test_environment.py index 166c86f0e1..b3e0cc2447 100644 --- a/chrome/test/chromedriver/test/test_environment.py +++ b/chrome/test/chromedriver/test/test_environment.py @@ -18,9 +18,9 @@ _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) if util.IsLinux(): sys.path.insert(0, os.path.join(chrome_paths.GetSrc(), 'build', 'android')) - from pylib import android_commands from pylib import forwarder from pylib import valgrind_tools + from pylib.device import device_utils ANDROID_TEST_HTTP_PORT = 2311 ANDROID_TEST_HTTPS_PORT = 2411 @@ -87,22 +87,22 @@ class AndroidTestEnvironment(DesktopTestEnvironment): def __init__(self, package, chrome_version='HEAD'): super(AndroidTestEnvironment, self).__init__(chrome_version) self._package = package - self._adb = None + self._device = None self._forwarder = None # override def GlobalSetUp(self): os.putenv('TEST_HTTP_PORT', str(ANDROID_TEST_HTTP_PORT)) os.putenv('TEST_HTTPS_PORT', str(ANDROID_TEST_HTTPS_PORT)) - self._adb = android_commands.AndroidCommands() + self._device = device_utils.DeviceUtils(None) forwarder.Forwarder.Map( [(ANDROID_TEST_HTTP_PORT, ANDROID_TEST_HTTP_PORT), (ANDROID_TEST_HTTPS_PORT, ANDROID_TEST_HTTPS_PORT)], - self._adb) + self._device) # override def GlobalTearDown(self): - forwarder.Forwarder.UnmapAllDevicePorts(self._adb) + forwarder.Forwarder.UnmapAllDevicePorts(self._device) # override def GetOS(self): diff --git a/chrome/test/nacl/nacl_browsertest.cc b/chrome/test/nacl/nacl_browsertest.cc index 9b6168c999..cd31331fc7 100644 --- a/chrome/test/nacl/nacl_browsertest.cc +++ b/chrome/test/nacl/nacl_browsertest.cc @@ -144,6 +144,22 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestNewlib, IrtManifestFile) { RunNaClIntegrationTest(FILE_PATH_LITERAL("irt_manifest_file_test.html")); } +// The NonSFI test is currently available only on linux-x86-32 +// architecture. +#if defined(OS_LINUX) && defined(ARCH_CPU_X86) +#define MAYBE_NONSFI(test_name) test_name +#else +#define MAYBE_NONSFI(test_name) DISABLED_##test_name +#endif + +IN_PROC_BROWSER_TEST_F(NaClBrowserTestNewlib, IrtException) { + RunNaClIntegrationTest(FILE_PATH_LITERAL("irt_exception_test.html")); +} +IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnaclNonSfi, + MAYBE_NONSFI(IrtException)) { + RunNaClIntegrationTest(FILE_PATH_LITERAL("irt_exception_test.html")); +} + NACL_BROWSER_TEST_F(NaClBrowserTest, Nameservice, { RunNaClIntegrationTest(FILE_PATH_LITERAL("pm_nameservice_test.html")); }) diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc index 97058b8315..8843aa9843 100644 --- a/chrome/test/nacl/nacl_browsertest_util.cc +++ b/chrome/test/nacl/nacl_browsertest_util.cc @@ -338,3 +338,13 @@ bool NaClBrowserTestStatic::GetDocumentRoot(base::FilePath* document_root) { *document_root = base::FilePath(FILE_PATH_LITERAL("chrome/test/data/nacl")); return true; } + +base::FilePath::StringType NaClBrowserTestPnaclNonSfi::Variant() { + return FILE_PATH_LITERAL("nonsfi"); +} + +void NaClBrowserTestPnaclNonSfi::SetUpCommandLine( + base::CommandLine* command_line) { + NaClBrowserTestBase::SetUpCommandLine(command_line); + command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); +} diff --git a/chrome/test/nacl/nacl_browsertest_util.h b/chrome/test/nacl/nacl_browsertest_util.h index 417659322d..22fd852c9d 100644 --- a/chrome/test/nacl/nacl_browsertest_util.h +++ b/chrome/test/nacl/nacl_browsertest_util.h @@ -123,6 +123,12 @@ class NaClBrowserTestPnacl : public NaClBrowserTestBase { virtual bool IsAPnaclTest() OVERRIDE; }; +class NaClBrowserTestPnaclNonSfi : public NaClBrowserTestBase { + public: + virtual base::FilePath::StringType Variant() OVERRIDE; + virtual void SetUpCommandLine(base::CommandLine* command_line) OVERRIDE; +}; + // Class used to test that when --disable-pnacl is specified the PNaCl mime // type is not available. class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { diff --git a/chrome/test/perf/url_parse_perftest.cc b/chrome/test/perf/url_parse_perftest.cc index 61ebcb1ce2..76ae046acf 100644 --- a/chrome/test/perf/url_parse_perftest.cc +++ b/chrome/test/perf/url_parse_perftest.cc @@ -26,11 +26,11 @@ TEST(URLParse, FullURL) { const char url[] = "http://me:pass@host/foo/bar.html;param?query=yes#ref"; int url_len = static_cast<int>(strlen(url)); - url_parse::Parsed parsed; + url::Parsed parsed; base::PerfTimeLogger timer("Full_URL_Parse_AMillion"); for (int i = 0; i < 1000000; i++) - url_parse::ParseStandardURL(url, url_len, &parsed); + url::ParseStandardURL(url, url_len, &parsed); timer.Done(); } @@ -48,43 +48,43 @@ int typical_url3_len = static_cast<int>(strlen(typical_url3)); } // namespace TEST(URLParse, TypicalURLParse) { - url_parse::Parsed parsed1; - url_parse::Parsed parsed2; - url_parse::Parsed parsed3; + url::Parsed parsed1; + url::Parsed parsed2; + url::Parsed parsed3; // Do this 1/3 of a million times since we do 3 different URLs. base::PerfTimeLogger parse_timer("Typical_URL_Parse_AMillion"); for (int i = 0; i < 333333; i++) { - url_parse::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); - url_parse::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); - url_parse::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); + url::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); + url::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); + url::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); } parse_timer.Done(); } // Includes both parsing and canonicalization with no mallocs. TEST(URLParse, TypicalURLParseCanon) { - url_parse::Parsed parsed1; - url_parse::Parsed parsed2; - url_parse::Parsed parsed3; + url::Parsed parsed1; + url::Parsed parsed2; + url::Parsed parsed3; base::PerfTimeLogger canon_timer("Typical_Parse_Canon_AMillion"); - url_parse::Parsed out_parsed; - url_canon::RawCanonOutput<1024> output; + url::Parsed out_parsed; + url::RawCanonOutput<1024> output; for (int i = 0; i < 333333; i++) { // divide by 3 so we get 1M - url_parse::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); + url::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); output.set_length(0); - url_canon::CanonicalizeStandardURL(typical_url1, typical_url1_len, parsed1, + url::CanonicalizeStandardURL(typical_url1, typical_url1_len, parsed1, NULL, &output, &out_parsed); - url_parse::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); + url::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); output.set_length(0); - url_canon::CanonicalizeStandardURL(typical_url2, typical_url2_len, parsed2, + url::CanonicalizeStandardURL(typical_url2, typical_url2_len, parsed2, NULL, &output, &out_parsed); - url_parse::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); + url::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); output.set_length(0); - url_canon::CanonicalizeStandardURL(typical_url3, typical_url3_len, parsed3, + url::CanonicalizeStandardURL(typical_url3, typical_url3_len, parsed3, NULL, &output, &out_parsed); } canon_timer.Done(); @@ -92,29 +92,29 @@ TEST(URLParse, TypicalURLParseCanon) { // Includes both parsing and canonicalization, and mallocs for the output. TEST(URLParse, TypicalURLParseCanonStdString) { - url_parse::Parsed parsed1; - url_parse::Parsed parsed2; - url_parse::Parsed parsed3; + url::Parsed parsed1; + url::Parsed parsed2; + url::Parsed parsed3; base::PerfTimeLogger canon_timer("Typical_Parse_Canon_AMillion"); - url_parse::Parsed out_parsed; + url::Parsed out_parsed; for (int i = 0; i < 333333; i++) { // divide by 3 so we get 1M - url_parse::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); + url::ParseStandardURL(typical_url1, typical_url1_len, &parsed1); std::string out1; - url_canon::StdStringCanonOutput output1(&out1); - url_canon::CanonicalizeStandardURL(typical_url1, typical_url1_len, parsed1, + url::StdStringCanonOutput output1(&out1); + url::CanonicalizeStandardURL(typical_url1, typical_url1_len, parsed1, NULL, &output1, &out_parsed); - url_parse::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); + url::ParseStandardURL(typical_url2, typical_url2_len, &parsed2); std::string out2; - url_canon::StdStringCanonOutput output2(&out2); - url_canon::CanonicalizeStandardURL(typical_url2, typical_url2_len, parsed2, + url::StdStringCanonOutput output2(&out2); + url::CanonicalizeStandardURL(typical_url2, typical_url2_len, parsed2, NULL, &output2, &out_parsed); - url_parse::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); + url::ParseStandardURL(typical_url3, typical_url3_len, &parsed3); std::string out3; - url_canon::StdStringCanonOutput output3(&out3); - url_canon::CanonicalizeStandardURL(typical_url3, typical_url3_len, parsed3, + url::StdStringCanonOutput output3(&out3); + url::CanonicalizeStandardURL(typical_url3, typical_url3_len, parsed3, NULL, &output3, &out_parsed); } canon_timer.Done(); diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index 8da58e621b..aefc4e9cf5 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -168,7 +168,7 @@ GURL PPAPITestBase::GetTestFileUrl(const std::string& test_case) { GURL::Replacements replacements; std::string query = BuildQuery(std::string(), test_case); - replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); + replacements.SetQuery(query.c_str(), url::Component(0, query.size())); return test_url.ReplaceComponents(replacements); } |