diff options
author | Ben Murdoch <benm@google.com> | 2013-07-30 15:19:42 +0100 |
---|---|---|
committer | Ben Murdoch <benm@google.com> | 2013-07-30 15:19:42 +0100 |
commit | 558790d6acca3451cf3a6b497803a5f07d0bec58 (patch) | |
tree | fcc36c3da74559ee6015cb5e9f596105cdc9f56e /chrome/test | |
parent | 8643c35ec8e6546ae6e04c51e08c4d57d40e88da (diff) | |
download | chromium_org-558790d6acca3451cf3a6b497803a5f07d0bec58.tar.gz |
Merge from Chromium at DEPS revision r214332
This commit was generated by merge_to_master.py.
Change-Id: I82a7c38de906244dc882493568013be659aa65d1
Diffstat (limited to 'chrome/test')
20 files changed, 137 insertions, 170 deletions
diff --git a/chrome/test/automation/tab_proxy.cc b/chrome/test/automation/tab_proxy.cc index 29bf9a6a2b..fa1fb6ef5d 100644 --- a/chrome/test/automation/tab_proxy.cc +++ b/chrome/test/automation/tab_proxy.cc @@ -411,10 +411,6 @@ void TabProxy::Paste() { sender_->Send(new AutomationMsg_Paste(handle_)); } -void TabProxy::SimulateKeyPress(ui::KeyboardCode key) { - sender_->Send(new AutomationMsg_KeyPress(handle_, key)); -} - void TabProxy::ReloadAsync() { sender_->Send(new AutomationMsg_ReloadAsync(handle_)); } diff --git a/chrome/test/automation/tab_proxy.h b/chrome/test/automation/tab_proxy.h index dff13441ff..ed8b12deaf 100644 --- a/chrome/test/automation/tab_proxy.h +++ b/chrome/test/automation/tab_proxy.h @@ -224,9 +224,6 @@ class TabProxy : public AutomationResourceProxy { void Copy(); void Paste(); - // Simulates a key press. |key| is the virtual key code of the key pressed. - void SimulateKeyPress(ui::KeyboardCode key); - // These handlers issue asynchronous Reload, Stop and SaveAs notifications to // the chrome instance. void ReloadAsync(); diff --git a/chrome/test/base/testing_browser_process.cc b/chrome/test/base/testing_browser_process.cc index 5e12543eae..8f68ec19f3 100644 --- a/chrome/test/base/testing_browser_process.cc +++ b/chrome/test/base/testing_browser_process.cc @@ -329,13 +329,6 @@ chrome::StorageMonitor* TestingBrowserProcess::storage_monitor() { NOTIMPLEMENTED(); return NULL; #else - if (!storage_monitor_.get()) { - chrome::test::TestStorageMonitor* monitor = - new chrome::test::TestStorageMonitor(); - monitor->Init(); - monitor->MarkInitialized(); - storage_monitor_.reset(monitor); - } return storage_monitor_.get(); #endif } @@ -422,6 +415,6 @@ void TestingBrowserProcess::SetSafeBrowsingService( void TestingBrowserProcess::SetStorageMonitor( scoped_ptr<chrome::StorageMonitor> storage_monitor) { #if !defined(OS_IOS) && !defined(OS_ANDROID) - storage_monitor_.reset(storage_monitor.release()); + storage_monitor_ = storage_monitor.Pass(); #endif } diff --git a/chrome/test/functional/perf.py b/chrome/test/functional/perf.py index 16231f7f62..61e9fe6142 100755 --- a/chrome/test/functional/perf.py +++ b/chrome/test/functional/perf.py @@ -170,7 +170,7 @@ class BasePerfTest(pyauto.PyUITest): logging.info('_WaitForChromeExit() took: %s seconds', time.time() - initial_time) return - self.fail('_WaitForChromeExit() did not finish within %s seconds', + self.fail('_WaitForChromeExit() did not finish within %s seconds' % timeout) def tearDown(self): @@ -178,7 +178,7 @@ class BasePerfTest(pyauto.PyUITest): browser_info = self.GetBrowserInfo() pid = browser_info['browser_pid'] os.kill(pid, signal.SIGINT) - self._WaitForChromeExit(browser_info, 30) + self._WaitForChromeExit(browser_info, 120) pyauto.PyUITest.tearDown(self) diff --git a/chrome/test/gpu/test_support_gpu.gypi b/chrome/test/gpu/test_support_gpu.gypi index 7a96dc3686..4be0e52595 100644 --- a/chrome/test/gpu/test_support_gpu.gypi +++ b/chrome/test/gpu/test_support_gpu.gypi @@ -59,6 +59,7 @@ '<(SHARED_INTERMEDIATE_DIR)/chrome_version/other_version.rc', '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.rc', '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.rc', + '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.rc', '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_chromium_resources.rc', ], 'conditions': [ diff --git a/chrome/test/gpu/webgl_infobar_browsertest.cc b/chrome/test/gpu/webgl_infobar_browsertest.cc index 41807a5a06..c22f59b60a 100644 --- a/chrome/test/gpu/webgl_infobar_browsertest.cc +++ b/chrome/test/gpu/webgl_infobar_browsertest.cc @@ -28,6 +28,10 @@ #include "testing/gtest/include/gtest/gtest.h" #include "ui/gl/gl_implementation.h" +#if defined(OS_WIN) && defined(USE_ASH) +#include "base/win/windows_version.h" +#endif + namespace { void SimulateGPUCrash(Browser* browser) { @@ -66,6 +70,12 @@ class WebGLInfobarTest : public InProcessBrowserTest { }; IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { +#if defined(OS_WIN) && defined(USE_ASH) + // Disable this test in Metro+Ash for now (http://crbug.com/262796). + if (base::win::GetVersion() >= base::win::VERSION_WIN8) + return; +#endif + if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) return; @@ -91,6 +101,12 @@ IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossRaisesInfobar) { } IN_PROC_BROWSER_TEST_F(WebGLInfobarTest, ContextLossInfobarReload) { +#if defined(OS_WIN) && defined(USE_ASH) + // Disable this test in Metro+Ash for now (http://crbug.com/262796). + if (base::win::GetVersion() >= base::win::VERSION_WIN8) + return; +#endif + if (gpu::GPUTestBotConfig::CurrentConfigMatches("XP")) return; diff --git a/chrome/test/nacl/nacl_browsertest.cc b/chrome/test/nacl/nacl_browsertest.cc index f8af44ca12..e24b910370 100644 --- a/chrome/test/nacl/nacl_browsertest.cc +++ b/chrome/test/nacl/nacl_browsertest.cc @@ -85,10 +85,6 @@ NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_ProgressEvents, { RunNaClIntegrationTest(FILE_PATH_LITERAL("ppapi_progress_events.html")); }) -NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_PnaclMimeType, { - RunLoadTest(FILE_PATH_LITERAL("pnacl_mime_type.html")); -}) - // Some versions of Visual Studio does not like preprocessor // conditionals inside the argument of a macro, so we put the // conditionals on a helper function. We are already in an anonymous @@ -192,4 +188,13 @@ IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnacl, "pnacl_exception_handling_disabled.html")); } +IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnacl, MAYBE_PNACL(PnaclMimeType)) { + RunLoadTest(FILE_PATH_LITERAL("pnacl_mime_type.html")); +} + +IN_PROC_BROWSER_TEST_F(NaClBrowserTestPnaclDisabled, + MAYBE_PNACL(PnaclMimeType)) { + RunLoadTest(FILE_PATH_LITERAL("pnacl_mime_type.html")); +} + } // namespace diff --git a/chrome/test/nacl/nacl_browsertest_uma.cc b/chrome/test/nacl/nacl_browsertest_uma.cc index eaabd8a150..a76776cc98 100644 --- a/chrome/test/nacl/nacl_browsertest_uma.cc +++ b/chrome/test/nacl/nacl_browsertest_uma.cc @@ -34,7 +34,7 @@ NACL_BROWSER_TEST_F(NaClBrowserTest, MAYBE_SuccessfulLoadUMA, { LOAD_OK, 1); // Make sure we have other important histograms. - if (!IsPnacl()) { + if (!IsAPnaclTest()) { histograms.ExpectTotalCount("NaCl.Perf.StartupTime.LoadModule", 1); histograms.ExpectTotalCount("NaCl.Perf.StartupTime.Total", 1); histograms.ExpectTotalCount("NaCl.Perf.Size.Manifest", 1); diff --git a/chrome/test/nacl/nacl_browsertest_util.cc b/chrome/test/nacl/nacl_browsertest_util.cc index 48cde92d72..c1e5655544 100644 --- a/chrome/test/nacl/nacl_browsertest_util.cc +++ b/chrome/test/nacl/nacl_browsertest_util.cc @@ -187,6 +187,15 @@ static void AddPnaclParm(const base::FilePath::StringType& url, } } +static void AddPnaclDisabledParm(const base::FilePath::StringType& url, + base::FilePath::StringType* url_with_parm) { + if (url.find(FILE_PATH_LITERAL("?")) == base::FilePath::StringType::npos) { + *url_with_parm = url + FILE_PATH_LITERAL("?pnacl_disabled=1"); + } else { + *url_with_parm = url + FILE_PATH_LITERAL("&pnacl_disabled=1"); + } +} + NaClBrowserTestBase::NaClBrowserTestBase() { } @@ -211,7 +220,11 @@ bool NaClBrowserTestBase::GetDocumentRoot(base::FilePath* document_root) { return GetNaClVariantRoot(Variant(), document_root); } -bool NaClBrowserTestBase::IsPnacl() { +bool NaClBrowserTestBase::IsAPnaclTest() { + return false; +} + +bool NaClBrowserTestBase::IsPnaclDisabled() { return false; } @@ -234,11 +247,15 @@ bool NaClBrowserTestBase::RunJavascriptTest(const GURL& url, void NaClBrowserTestBase::RunLoadTest( const base::FilePath::StringType& test_file) { LoadTestMessageHandler handler; - base::FilePath::StringType test_file_with_parm = test_file; - if (IsPnacl()) { - AddPnaclParm(test_file, &test_file_with_parm); + base::FilePath::StringType test_file_with_pnacl = test_file; + if (IsAPnaclTest()) { + AddPnaclParm(test_file, &test_file_with_pnacl); } - bool ok = RunJavascriptTest(TestURL(test_file_with_parm), &handler); + base::FilePath::StringType test_file_with_both = test_file_with_pnacl; + if (IsPnaclDisabled()) { + AddPnaclDisabledParm(test_file_with_pnacl, &test_file_with_both); + } + bool ok = RunJavascriptTest(TestURL(test_file_with_both), &handler); ASSERT_TRUE(ok) << handler.error_message(); ASSERT_TRUE(handler.test_passed()) << "Test failed."; } @@ -246,11 +263,15 @@ void NaClBrowserTestBase::RunLoadTest( void NaClBrowserTestBase::RunNaClIntegrationTest( const base::FilePath::StringType& url_fragment) { NaClIntegrationMessageHandler handler; - base::FilePath::StringType url_fragment_with_parm = url_fragment; - if (IsPnacl()) { - AddPnaclParm(url_fragment, &url_fragment_with_parm); + base::FilePath::StringType url_fragment_with_pnacl = url_fragment; + if (IsAPnaclTest()) { + AddPnaclParm(url_fragment, &url_fragment_with_pnacl); + } + base::FilePath::StringType url_fragment_with_both = url_fragment_with_pnacl; + if (IsPnaclDisabled()) { + AddPnaclDisabledParm(url_fragment_with_pnacl, &url_fragment_with_both); } - bool ok = RunJavascriptTest(TestURL(url_fragment_with_parm), &handler); + bool ok = RunJavascriptTest(TestURL(url_fragment_with_both), &handler); ASSERT_TRUE(ok) << handler.error_message(); ASSERT_TRUE(handler.test_passed()) << "Test failed."; } @@ -279,13 +300,25 @@ base::FilePath::StringType NaClBrowserTestPnacl::Variant() { return FILE_PATH_LITERAL("pnacl"); } -bool NaClBrowserTestPnacl::IsPnacl() { +bool NaClBrowserTestPnacl::IsAPnaclTest() { + return true; +} + +base::FilePath::StringType NaClBrowserTestPnaclDisabled::Variant() { + return FILE_PATH_LITERAL("pnacl"); +} + +bool NaClBrowserTestPnaclDisabled::IsAPnaclTest() { + return true; +} + +bool NaClBrowserTestPnaclDisabled::IsPnaclDisabled() { return true; } -void NaClBrowserTestPnacl::SetUpCommandLine(CommandLine* command_line) { +void NaClBrowserTestPnaclDisabled::SetUpCommandLine(CommandLine* command_line) { NaClBrowserTestBase::SetUpCommandLine(command_line); - command_line->AppendSwitch(switches::kEnablePnacl); + command_line->AppendSwitch(switches::kDisablePnacl); } NaClBrowserTestPnaclWithNewCache::NaClBrowserTestPnaclWithNewCache() { diff --git a/chrome/test/nacl/nacl_browsertest_util.h b/chrome/test/nacl/nacl_browsertest_util.h index 914f6ebc49..ba58e93f2e 100644 --- a/chrome/test/nacl/nacl_browsertest_util.h +++ b/chrome/test/nacl/nacl_browsertest_util.h @@ -74,7 +74,9 @@ class NaClBrowserTestBase : public InProcessBrowserTest { // Where are the files for this class of test located on disk? virtual bool GetDocumentRoot(base::FilePath* document_root); - virtual bool IsPnacl(); + virtual bool IsAPnaclTest(); + + virtual bool IsPnaclDisabled(); // Map a file relative to the variant directory to a URL served by the test // web server. @@ -116,11 +118,22 @@ class NaClBrowserTestGLibc : public NaClBrowserTestBase { class NaClBrowserTestPnacl : public NaClBrowserTestBase { public: + virtual base::FilePath::StringType Variant() OVERRIDE; + + virtual bool IsAPnaclTest() OVERRIDE; +}; + +// Class used to test that when --disable-pnacl is specified the PNaCl mime +// type is not available. +class NaClBrowserTestPnaclDisabled : public NaClBrowserTestBase { + public: virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; virtual base::FilePath::StringType Variant() OVERRIDE; - virtual bool IsPnacl() OVERRIDE; + virtual bool IsAPnaclTest() OVERRIDE; + + virtual bool IsPnaclDisabled() OVERRIDE; }; // Temporary class for running tests with the new cache enabled. Once all the @@ -157,7 +170,7 @@ body #else -// Otherwise, we have Glibc, Newlib and PNaCl tests +// Otherwise, we have Glibc, Newlib, and Pnacl tests #define NACL_BROWSER_TEST_F(suite, name, body) \ IN_PROC_BROWSER_TEST_F(suite##Newlib, name) \ body \ diff --git a/chrome/test/perf/memory_test.cc b/chrome/test/perf/memory_test.cc index 3812044024..9a78571d20 100644 --- a/chrome/test/perf/memory_test.cc +++ b/chrome/test/perf/memory_test.cc @@ -10,10 +10,10 @@ #include "base/strings/string_util.h" #include "base/threading/platform_thread.h" #include "base/threading/thread_restrictions.h" -#include "chrome/browser/net/url_fixer_upper.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/net/url_fixer_upper.h" #include "chrome/test/automation/automation_proxy.h" #include "chrome/test/automation/browser_proxy.h" #include "chrome/test/automation/tab_proxy.h" diff --git a/chrome/test/perf/rendering/throughput_tests.cc b/chrome/test/perf/rendering/throughput_tests.cc index e54c2241bf..4aab2e766a 100644 --- a/chrome/test/perf/rendering/throughput_tests.cc +++ b/chrome/test/perf/rendering/throughput_tests.cc @@ -13,13 +13,13 @@ #include "base/strings/stringprintf.h" #include "base/test/trace_event_analyzer.h" #include "base/values.h" -#include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/tabs/tab_strip_model.h" #include "chrome/browser/ui/window_snapshot/window_snapshot.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" +#include "chrome/common/net/url_fixer_upper.h" #include "chrome/test/base/test_switches.h" #include "chrome/test/base/tracing.h" #include "chrome/test/base/ui_test_utils.h" diff --git a/chrome/test/ppapi/ppapi_test.cc b/chrome/test/ppapi/ppapi_test.cc index df11ee762c..5973877c44 100644 --- a/chrome/test/ppapi/ppapi_test.cc +++ b/chrome/test/ppapi/ppapi_test.cc @@ -339,9 +339,8 @@ void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); EXPECT_TRUE(base::PathExists(plugin_lib)); - // Enable running NaCl outside of the store. + // Enable running (non-portable) NaCl outside of the Chrome web store. command_line->AppendSwitch(switches::kEnableNaCl); - command_line->AppendSwitch(switches::kEnablePnacl); command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); @@ -376,9 +375,8 @@ void PPAPINaClTestDisallowedSockets::SetUpCommandLine( EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); EXPECT_TRUE(base::PathExists(plugin_lib)); - // Enable running NaCl outside of the store. + // Enable running (non-portable) NaCl outside of the Chrome web store. command_line->AppendSwitch(switches::kEnableNaCl); - command_line->AppendSwitch(switches::kEnablePnacl); } // Append the correct mode and testcase string diff --git a/chrome/test/pyautolib/remote_inspector_client.py b/chrome/test/pyautolib/remote_inspector_client.py index 2e354ef23e..ca70bb2386 100755 --- a/chrome/test/pyautolib/remote_inspector_client.py +++ b/chrome/test/pyautolib/remote_inspector_client.py @@ -747,7 +747,8 @@ class RemoteInspectorClient(object): # TODO(dennisjeffrey): Allow a user to specify a window index too (not just a # tab index), when running through PyAuto. def __init__(self, tab_index=0, tab_filter=None, - verbose=False, show_socket_messages=False): + verbose=False, show_socket_messages=False, + url='http://localhost:9222'): """Initialize. Args: @@ -776,10 +777,6 @@ class RemoteInspectorClient(object): self._remote_inspector_thread = None self._remote_inspector_driver_thread = None - # TODO(dennisjeffrey): Do not assume port 9222. The port should be passed - # as input to this function. - url = 'http://localhost:9222' - self._version = self._GetVersion(url) # TODO(loislo): Remove this hack after M28 is released. diff --git a/chrome/test/reliability/automated_ui_tests.cc b/chrome/test/reliability/automated_ui_tests.cc index 0c36fff56b..2f43c29ef8 100644 --- a/chrome/test/reliability/automated_ui_tests.cc +++ b/chrome/test/reliability/automated_ui_tests.cc @@ -388,8 +388,6 @@ bool AutomatedUITest::DoAction(const std::string& action) { did_complete_action = ForceCrash(); } else if (LowerCaseEqualsASCII(action, "dialog")) { did_complete_action = ExerciseDialog(); - } else if (LowerCaseEqualsASCII(action, "downarrow")) { - did_complete_action = PressDownArrow(); } else if (LowerCaseEqualsASCII(action, "downloads")) { did_complete_action = ShowDownloads(); } else if (LowerCaseEqualsASCII(action, "duplicatetab")) { @@ -423,18 +421,6 @@ bool AutomatedUITest::DoAction(const std::string& action) { did_complete_action = OpenAndActivateNewBrowserWindow(NULL); } else if (LowerCaseEqualsASCII(action, "options")) { did_complete_action = Options(); - } else if (LowerCaseEqualsASCII(action, "pagedown")) { - did_complete_action = PressPageDown(); - } else if (LowerCaseEqualsASCII(action, "pageup")) { - did_complete_action = PressPageUp(); - } else if (LowerCaseEqualsASCII(action, "pressenterkey")) { - did_complete_action = PressEnterKey(); - } else if (LowerCaseEqualsASCII(action, "pressescapekey")) { - did_complete_action = PressEscapeKey(); - } else if (LowerCaseEqualsASCII(action, "pressspacebar")) { - did_complete_action = PressSpaceBar(); - } else if (LowerCaseEqualsASCII(action, "presstabkey")) { - did_complete_action = PressTabKey(); } else if (LowerCaseEqualsASCII(action, "reload")) { did_complete_action = ReloadPage(); } else if (LowerCaseEqualsASCII(action, "restoretab")) { @@ -472,8 +458,6 @@ bool AutomatedUITest::DoAction(const std::string& action) { did_complete_action = TestTaskManager(); } else if (LowerCaseEqualsASCII(action, "testviewpasswords")) { did_complete_action = TestViewPasswords(); - } else if (LowerCaseEqualsASCII(action, "uparrow")) { - did_complete_action = PressUpArrow(); } else if (LowerCaseEqualsASCII(action, "viewpasswords")) { did_complete_action = OpenViewPasswordsDialog(); } else if (LowerCaseEqualsASCII(action, "viewsource")) { @@ -553,38 +537,6 @@ bool AutomatedUITest::Options() { return RunCommandAsync(IDC_OPTIONS); } -bool AutomatedUITest::PressDownArrow() { - return SimulateKeyPress(ui::VKEY_DOWN); -} - -bool AutomatedUITest::PressEnterKey() { - return SimulateKeyPress(ui::VKEY_RETURN); -} - -bool AutomatedUITest::PressEscapeKey() { - return SimulateKeyPress(ui::VKEY_ESCAPE); -} - -bool AutomatedUITest::PressPageDown() { - return SimulateKeyPress(ui::VKEY_PRIOR); -} - -bool AutomatedUITest::PressPageUp() { - return SimulateKeyPress(ui::VKEY_NEXT); -} - -bool AutomatedUITest::PressSpaceBar() { - return SimulateKeyPress(ui::VKEY_SPACE); -} - -bool AutomatedUITest::PressTabKey() { - return SimulateKeyPress(ui::VKEY_TAB); -} - -bool AutomatedUITest::PressUpArrow() { - return SimulateKeyPress(ui::VKEY_UP); -} - bool AutomatedUITest::StarPage() { return RunCommandAsync(IDC_BOOKMARK_PAGE); } @@ -672,12 +624,6 @@ bool AutomatedUITest::ForceCrash() { return true; } -bool AutomatedUITest::SimulateKeyPress(ui::KeyboardCode key) { - scoped_refptr<TabProxy> tab(GetActiveTab()); - tab->SimulateKeyPress(key); - return true; -} - bool AutomatedUITest::InitXMLReader() { base::FilePath input_path = GetInputFilePath(); diff --git a/chrome/test/reliability/automated_ui_tests.h b/chrome/test/reliability/automated_ui_tests.h index 083001bea2..06cd21f58b 100644 --- a/chrome/test/reliability/automated_ui_tests.h +++ b/chrome/test/reliability/automated_ui_tests.h @@ -187,38 +187,6 @@ class AutomatedUITest : public AutomatedUITestBase { // XML element: <Options/> bool Options(); - // Simulates a page up key press on the active window. - // XML element: <DownArrow/> - bool PressDownArrow(); - - // Simulates an enter key press on the active window. - // XML element: <PressEnterKey/> - bool PressEnterKey(); - - // Simulates an escape key press on the active window. - // XML element: <PressEscapeKey/> - bool PressEscapeKey(); - - // Simulates a page down key press on the active window. - // XML element: <PageDown/> - bool PressPageDown(); - - // Simulates a page up key press on the active window. - // XML element: <PageUp/> - bool PressPageUp(); - - // Simulates a space bar press on the active window. - // XML element: <PressSpaceBar/> - bool PressSpaceBar(); - - // Simulates a tab key press on the active window. - // XML element: <PressTabKey/> - bool PressTabKey(); - - // Simulates a page up key press on the active window. - // XML element: <UpArrow/> - bool PressUpArrow(); - // Stars the current page. This opens a dialog that may or may not be // dismissed. // XML element: <Star/> @@ -292,9 +260,6 @@ class AutomatedUITest : public AutomatedUITestBase { // Utility functions -------------------------------------------------------- - // Calls SimulateKeyPress on the active tab. |key| is the key pressed. - bool SimulateKeyPress(ui::KeyboardCode key); - // Opens init file, reads it into the reader, and closes the file. // Returns false if there are any errors. bool InitXMLReader(); diff --git a/chrome/test/reliability/page_load_test.cc b/chrome/test/reliability/page_load_test.cc index 9f32162fc5..9321537204 100644 --- a/chrome/test/reliability/page_load_test.cc +++ b/chrome/test/reliability/page_load_test.cc @@ -28,7 +28,6 @@ // --memoryusage: prints out memory usage when visiting each page. // --endurl=url: visits the specified url in the end. // --logfile=filepath: saves the visit log to the specified path. -// --nopagedown: won't simulate page down key presses after page load. // --noclearprofile: do not clear profile dir before firing up each time. // --savedebuglog: save Chrome, V8, and test debug log for each page loaded. // --searchdumpsbypid: Look for crash dumps by browser process id. @@ -55,7 +54,6 @@ #include "base/test/test_file_util.h" #include "base/threading/platform_thread.h" #include "base/time/time.h" -#include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/prefs/pref_service_mock_builder.h" #include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" @@ -63,6 +61,7 @@ #include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_version_info.h" #include "chrome/common/logging_chrome.h" +#include "chrome/common/net/url_fixer_upper.h" #include "chrome/common/pref_names.h" #include "chrome/common/render_messages.h" #include "chrome/common/url_constants.h" @@ -72,7 +71,6 @@ #include "chrome/test/automation/window_proxy.h" #include "chrome/test/ui/ui_test.h" #include "net/base/net_util.h" -#include "ui/base/keycodes/keyboard_codes.h" #include "v8/include/v8-testing.h" namespace { @@ -117,7 +115,6 @@ int32 g_iterations = 1; bool g_memory_usage = false; bool g_continuous_load = false; bool g_browser_existing = false; -bool g_page_down = true; bool g_clear_profile = true; std::string g_end_url; base::FilePath g_log_file_path; @@ -203,9 +200,6 @@ void SetPageRange(const CommandLine& parsed_command_line) { if (parsed_command_line.HasSwitch(kLogFileSwitch)) g_log_file_path = parsed_command_line.GetSwitchValuePath(kLogFileSwitch); - if (parsed_command_line.HasSwitch(kNoPageDownSwitch)) - g_page_down = false; - if (parsed_command_line.HasSwitch(kNoClearProfileSwitch)) g_clear_profile = false; @@ -335,19 +329,6 @@ class PageLoadTest : public UITest { scoped_refptr<TabProxy> tab_proxy(GetActiveTab()); if (tab_proxy.get()) result = tab_proxy->NavigateToURL(url); - - if (result == AUTOMATION_MSG_NAVIGATION_SUCCESS) { - if (g_page_down) { - // Page down twice. - // Sleep for 2 seconds between commands. - // This used to be settable but the flag went away. - base::TimeDelta sleep_time = base::TimeDelta::FromSeconds(2); - tab_proxy->SimulateKeyPress(ui::VKEY_NEXT); - base::PlatformThread::Sleep(sleep_time); - tab_proxy->SimulateKeyPress(ui::VKEY_NEXT); - base::PlatformThread::Sleep(sleep_time); - } - } } // Log navigate complete time. @@ -470,12 +451,6 @@ class PageLoadTest : public UITest { return; // For usage 1 NavigationMetrics metrics; - // Though it would be nice to test the page down code path in usage 1, - // enabling page down adds several seconds to the test and does not seem - // worth the tradeoff. It is also potentially disruptive when running the - // test in the background as it will send the event to the window that - // has focus. - g_page_down = false; base::FilePath sample_data_dir = GetSampleDataDir(); base::FilePath test_page_1 = sample_data_dir.AppendASCII(kTestPage1); diff --git a/chrome/test/security_tests/sandbox_browsertest_linux.cc b/chrome/test/security_tests/sandbox_browsertest_linux.cc new file mode 100644 index 0000000000..f9c2659900 --- /dev/null +++ b/chrome/test/security_tests/sandbox_browsertest_linux.cc @@ -0,0 +1,34 @@ +// 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. + +#include "chrome/test/base/in_process_browser_test.h" +#include "content/public/browser/zygote_host_linux.h" +#include "content/public/common/sandbox_linux.h" + +typedef InProcessBrowserTest SandboxLinuxTest; + +// Both the SUID sandbox (http://crbug.com/137653) and the Seccomp-BPF sandbox +// are currently incompatible with ASan. +#if defined(OS_LINUX) && !defined(ADDRESS_SANITIZER) +#define MAYBE_SandboxStatus \ + SandboxStatus +#else +#define MAYBE_SandboxStatus \ + DISABLED_SandboxStatus +#endif + +IN_PROC_BROWSER_TEST_F(SandboxLinuxTest, MAYBE_SandboxStatus) { + // Get expected sandboxing status of renderers. + const int status = content::ZygoteHost::GetInstance()->GetSandboxStatus(); + + // The setuid sandbox is required as our first-layer sandbox. + bool good_layer1 = status & content::kSandboxLinuxSUID && + status & content::kSandboxLinuxPIDNS && + status & content::kSandboxLinuxNetNS; + // A second-layer sandbox is also required to be adequately sandboxed. + bool good_layer2 = status & content::kSandboxLinuxSeccompBpf; + + EXPECT_TRUE(good_layer1); + EXPECT_TRUE(good_layer2); +} diff --git a/chrome/test/security_tests/sandbox_browsertest.cc b/chrome/test/security_tests/sandbox_browsertest_win.cc index 8b09a95257..05c10bb5f3 100644 --- a/chrome/test/security_tests/sandbox_browsertest.cc +++ b/chrome/test/security_tests/sandbox_browsertest_win.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. +// 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. @@ -8,9 +8,9 @@ #include "chrome/common/chrome_switches.h" #include "chrome/test/base/in_process_browser_test.h" -class SandboxTest : public InProcessBrowserTest { +class SandboxWinTest : public InProcessBrowserTest { protected: - SandboxTest() : InProcessBrowserTest() {} + SandboxWinTest() : InProcessBrowserTest() {} virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { command_line->AppendSwitchASCII(switches::kTestSandbox, @@ -19,9 +19,7 @@ class SandboxTest : public InProcessBrowserTest { }; // Need a cross-platform test library: http://crbug.com/45771 -#if defined(OS_WIN) // Verifies that chrome is running properly. -IN_PROC_BROWSER_TEST_F(SandboxTest, ExecuteDll) { +IN_PROC_BROWSER_TEST_F(SandboxWinTest, ExecuteDll) { EXPECT_EQ(1, browser()->tab_strip_model()->count()); } -#endif diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc index 6d55efa725..3dd2263238 100644 --- a/chrome/test/ui/ui_test.cc +++ b/chrome/test/ui/ui_test.cc @@ -32,13 +32,13 @@ #include "base/threading/platform_thread.h" #include "base/time/time.h" #include "chrome/app/chrome_command_ids.h" -#include "chrome/browser/net/url_fixer_upper.h" #include "chrome/browser/profiles/profile_impl.h" #include "chrome/common/automation_messages.h" #include "chrome/common/chrome_constants.h" #include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/logging_chrome.h" +#include "chrome/common/net/url_fixer_upper.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/test/automation/automation_proxy.h" |