diff options
author | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-09 18:00:21 +0000 |
---|---|---|
committer | kkania@chromium.org <kkania@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-09 18:00:21 +0000 |
commit | 4b5580f7ccdf749070dca846d57c1cbdaeef1905 (patch) | |
tree | d5bb4a5ee4848ee7ffef84af468a04f38d31adff /chrome | |
parent | f82f05eae48c5dcd28899b24c6c0e6cc7273486f (diff) | |
download | chromium_src-4b5580f7ccdf749070dca846d57c1cbdaeef1905.zip chromium_src-4b5580f7ccdf749070dca846d57c1cbdaeef1905.tar.gz chromium_src-4b5580f7ccdf749070dca846d57c1cbdaeef1905.tar.bz2 |
[chromedriver] Move integration tests into test/ and update docs about how to run them.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/22697002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216719 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/test/chromedriver/DEPS | 1 | ||||
-rw-r--r-- | chrome/test/chromedriver/README.txt | 38 | ||||
-rw-r--r-- | chrome/test/chromedriver/chrome_paths.py | 3 | ||||
-rwxr-xr-x | chrome/test/chromedriver/run_buildbot_steps.py | 2 | ||||
-rw-r--r-- | chrome/test/chromedriver/test/java_tests.txt (renamed from chrome/test/chromedriver/java_tests.txt) | 0 | ||||
-rwxr-xr-x | chrome/test/chromedriver/test/run_all_tests.py (renamed from chrome/test/chromedriver/run_all_tests.py) | 10 | ||||
-rwxr-xr-x | chrome/test/chromedriver/test/run_java_tests.py (renamed from chrome/test/chromedriver/run_java_tests.py) | 15 | ||||
-rwxr-xr-x | chrome/test/chromedriver/test/run_py_tests.py (renamed from chrome/test/chromedriver/run_py_tests.py) | 12 | ||||
-rw-r--r-- | chrome/test/chromedriver/test/test_environment.py (renamed from chrome/test/chromedriver/test_environment.py) | 6 | ||||
-rw-r--r-- | chrome/test/chromedriver/test/unittest_util.py (renamed from chrome/test/chromedriver/unittest_util.py) | 2 | ||||
-rw-r--r-- | chrome/test/chromedriver/test/webserver.py (renamed from chrome/test/chromedriver/webserver.py) | 2 | ||||
-rw-r--r-- | chrome/test/chromedriver/test_expectations | 223 |
12 files changed, 53 insertions, 261 deletions
diff --git a/chrome/test/chromedriver/DEPS b/chrome/test/chromedriver/DEPS index 0d83e87..f4ece7a 100644 --- a/chrome/test/chromedriver/DEPS +++ b/chrome/test/chromedriver/DEPS @@ -5,7 +5,6 @@ include_rules = [ "+chrome/test/chromedriver", - "+third_party/mongoose", "+third_party/webdriver", "+third_party/zlib", ] diff --git a/chrome/test/chromedriver/README.txt b/chrome/test/chromedriver/README.txt index ef3d959..43126c4 100644 --- a/chrome/test/chromedriver/README.txt +++ b/chrome/test/chromedriver/README.txt @@ -49,34 +49,39 @@ which will execute on the dedicated session thread synchronously. When a command is finished, it will invoke a callback, which will eventually make its way back to the IO thread as a HTTP response for the server to send. -=====Code structure===== -1) chrome/test/chromedriver +=====Code structure (relative to this file)===== +1) . Implements chromedriver commands. -2) chrome/test/chromedriver/chrome -A basic interface for controlling Chrome via DevTools. Should not have -knowledge about WebDriver, and thus not depend on chrome/test/chromedriver. +2) chrome/ +A basic interface for controlling Chrome. Should not depend on or reference +WebDriver-related code or concepts. -3) chrome/test/chromedriver/js +3) js/ Javascript helper scripts. -4) chrome/test/chromedriver/net +4) net/ Code to deal with network communication, such as connection to DevTools. -5) chrome/test/chromedriver/client +5) client/ Code for a python client. -6) chrome/test/chromedriver/server +6) server/ Code for the chromedriver server. A python wrapper to the chromedriver server. -7) chrome/test/chromedriver/extension +7) extension/ An extension used for automating the desktop browser. -8) chrome/test/chromedriver/third_party +8) test/ +Integration tests. + +9) third_party/ Third party libraries used by chromedriver. =====Testing===== +See the ChromeDriver waterfall at: + http://build.chromium.org/p/chromium.chromedriver/waterfall There are 4 test suites for verifying ChromeDriver's correctness: 1) chromedriver2_unittests (chrome/chrome_tests.gypi) @@ -88,15 +93,14 @@ default. Tests should take a few milliseconds and be very stable. This is a collection of C++ medium sized tests which can be run optionally on the trybots. -3) python tests -These are integration tests which can be found in run_py_tests.py. They are -run on the chromium QA bots: - http://build.chromium.org/p/chromium.pyauto/waterfall +3) python integration tests +Run test/run_py_tests.py --help for more info. These are only run on the +ChromeDriver waterfall. 4) WebDriver Java acceptance tests These are integration tests from the WebDriver open source project which can -be run via run_java_tests.py. They are also run on the chromium QA bots. -See http://src.chromium.org/viewvc/chrome/trunk/deps/third_party/webdriver +be run via test/run_java_tests.py. They are only run on the ChromeDriver +bots. Run with --help for more info. =====Contributing===== Find an open issue and submit a patch for review by an individual listed in diff --git a/chrome/test/chromedriver/chrome_paths.py b/chrome/test/chromedriver/chrome_paths.py index a0d3812..5b9c976 100644 --- a/chrome/test/chromedriver/chrome_paths.py +++ b/chrome/test/chromedriver/chrome_paths.py @@ -12,7 +12,8 @@ _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) def GetSrc(): """Returns the path to the root src directory.""" - return os.path.join(_THIS_DIR, os.pardir, os.pardir, os.pardir) + return os.path.abspath(os.path.join(_THIS_DIR, os.pardir, os.pardir, + os.pardir)) def GetTestData(): diff --git a/chrome/test/chromedriver/run_buildbot_steps.py b/chrome/test/chromedriver/run_buildbot_steps.py index fb43b1f..af4a10b 100755 --- a/chrome/test/chromedriver/run_buildbot_steps.py +++ b/chrome/test/chromedriver/run_buildbot_steps.py @@ -202,7 +202,7 @@ def main(): cmd = [ sys.executable, - os.path.join(_THIS_DIR, 'run_all_tests.py'), + os.path.join(_THIS_DIR, 'test', 'run_all_tests.py'), ] if options.android_package: cmd.append('--android-package=' + options.android_package) diff --git a/chrome/test/chromedriver/java_tests.txt b/chrome/test/chromedriver/test/java_tests.txt index 7c54c86..7c54c86 100644 --- a/chrome/test/chromedriver/java_tests.txt +++ b/chrome/test/chromedriver/test/java_tests.txt diff --git a/chrome/test/chromedriver/run_all_tests.py b/chrome/test/chromedriver/test/run_all_tests.py index 574fa92..7236c86 100755 --- a/chrome/test/chromedriver/run_all_tests.py +++ b/chrome/test/chromedriver/test/run_all_tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2012 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. @@ -10,12 +10,13 @@ import os import platform import sys +_THIS_DIR = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir)) + import archive import chrome_paths import util -_THIS_DIR = os.path.abspath(os.path.dirname(__file__)) - def _AppendEnvironmentPath(env_name, path): if env_name in os.environ: @@ -153,7 +154,8 @@ def main(): _AddToolsToSystemPathForWindows() if options.android_package: - os.environ['PATH'] += os.pathsep + os.path.join(_THIS_DIR, 'chrome') + os.environ['PATH'] += os.pathsep + os.path.join( + _THIS_DIR, os.pardir, 'chrome') code1 = RunPythonTests(chromedriver, ref_chromedriver, android_package=options.android_package) diff --git a/chrome/test/chromedriver/run_java_tests.py b/chrome/test/chromedriver/test/run_java_tests.py index 495e49b..7259533 100755 --- a/chrome/test/chromedriver/run_java_tests.py +++ b/chrome/test/chromedriver/test/run_java_tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2012 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. @@ -17,6 +17,9 @@ import shutil import sys import xml.dom.minidom as minidom +_THIS_DIR = os.path.abspath(os.path.dirname(__file__)) +sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir)) + import chrome_paths import test_environment import util @@ -279,8 +282,14 @@ def main(): 'java_tests') if (not os.path.exists(java_tests_src_dir) or not os.listdir(java_tests_src_dir)): - print ('"%s" is empty or it doesn\'t exist.' % java_tests_src_dir + - 'Should add deps/third_party/webdriver to source checkout config') + java_tests_url = ('http://src.chromium.org/svn/trunk/deps/third_party' + '/webdriver') + print ('"%s" is empty or it doesn\'t exist. ' % java_tests_src_dir + + 'Need to map <chrome-svn>/trunk/deps/third_party/webdriver to ' + 'chrome/test/chromedriver/third_party/java_tests in .gclient.\n' + 'Alternatively, do:\n' + ' $ cd chrome/test/chromedriver/third_party\n' + ' $ svn co %s java_tests' % java_tests_url) return 1 results = [] diff --git a/chrome/test/chromedriver/run_py_tests.py b/chrome/test/chromedriver/test/run_py_tests.py index 35d6c9d..2acb869 100755 --- a/chrome/test/chromedriver/run_py_tests.py +++ b/chrome/test/chromedriver/test/run_py_tests.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2012 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. @@ -14,8 +14,9 @@ import time import unittest _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) -sys.path.insert(0, os.path.join(_THIS_DIR, 'client')) -sys.path.insert(0, os.path.join(_THIS_DIR, 'server')) +sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir)) +sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'client')) +sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, 'server')) import chrome_paths import chromedriver @@ -25,11 +26,10 @@ import server from webelement import WebElement import webserver -_TEST_DATA_DIR = os.path.join(_THIS_DIR, os.pardir, 'data', 'chromedriver') +_TEST_DATA_DIR = os.path.join(chrome_paths.GetTestData(), 'chromedriver') if util.IsLinux(): - sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, os.pardir, os.pardir, - 'build', 'android')) + 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 diff --git a/chrome/test/chromedriver/test_environment.py b/chrome/test/chromedriver/test/test_environment.py index 2344ad3..de8753b 100644 --- a/chrome/test/chromedriver/test_environment.py +++ b/chrome/test/chromedriver/test/test_environment.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012 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. @@ -11,13 +11,13 @@ tests in various environments. import os import sys +import chrome_paths import util _THIS_DIR = os.path.abspath(os.path.dirname(__file__)) if util.IsLinux(): - sys.path.insert(0, os.path.join(_THIS_DIR, os.pardir, os.pardir, os.pardir, - 'build', 'android')) + 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 diff --git a/chrome/test/chromedriver/unittest_util.py b/chrome/test/chromedriver/test/unittest_util.py index 9de9805..7c07312 100644 --- a/chrome/test/chromedriver/unittest_util.py +++ b/chrome/test/chromedriver/test/unittest_util.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012 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. diff --git a/chrome/test/chromedriver/webserver.py b/chrome/test/chromedriver/test/webserver.py index 170a48d..fb48cc5 100644 --- a/chrome/test/chromedriver/webserver.py +++ b/chrome/test/chromedriver/test/webserver.py @@ -1,4 +1,4 @@ -# Copyright (c) 2012 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. diff --git a/chrome/test/chromedriver/test_expectations b/chrome/test/chromedriver/test_expectations deleted file mode 100644 index 1e17ea2..0000000 --- a/chrome/test/chromedriver/test_expectations +++ /dev/null @@ -1,223 +0,0 @@ -# Copyright (c) 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. - -"""Test expectation list for WebDriver Java acceptance tests. - -It is evaluated through Python. -""" - -import fnmatch - - -_REVISION_NEGATIVE_FILTER = {} -_REVISION_NEGATIVE_FILTER['HEAD'] = [ - 'AlertsTest.testIncludesAlertTextInUnhandledAlertException', - 'AlertsTest.testSettingTheValueOfAnAlertThrows', - 'AlertsTest.testShouldGetTextOfAlertOpenedInSetTimeout', - 'AlertsTest.testShouldHandleAlertOnPageUnload', - 'AlertsTest.testShouldHandleAlertOnWindowClose', - 'AlertsTest.testShouldNotHandleAlertInAnotherWindow', - 'AlertsTest.testSwitchingToMissingAlertInAClosedWindowThrows', - 'AuthenticatedPageLoadingTest.*', - 'AvailableLogsTest.driverLogShouldBeEnabledByDefault', - 'BasicMouseInterfaceTest.testMousePositionIsNotPreservedInActionsChain', - 'BasicMouseInterfaceTest.testMovingIntoAnImageEnclosedInALink', - 'BasicMouseInterfaceTest.testMovingMouseBackAndForthPastViewPort', - 'BasicMouseInterfaceTest.testMovingMousePastViewPort', - 'ChromeOptionsFunctionalTest.canStartChromeWithCustomOptions', - 'ClickScrollingTest.testShouldBeAbleToClickOnAnElementHiddenByDoubleOverflow', - 'ClickScrollingTest.testShouldNotBeAbleToClickElementThatIsOutOfViewInANonScrollableFrame', - 'ClickScrollingTest.testShouldNotScrollIfAlreadyScrolledAndElementIsInView', - 'ClickTest.testCanClickAnImageMapArea', - 'ClickTest.testShouldBeAbleToClickOnAnElementInFrameGreaterThanTwoViewports', - 'CombinedInputActionsTest.testClickingOnFormElements', - 'CoordinatesTest.testShouldScrollPageAndGetCoordinatesOfAnElementThatIsOutOfViewPort', - 'CorrectEventFiringTest.testShouldFireEventsInTheRightOrder', - 'CorrectEventFiringTest.testShouldFireFocusEventWhenClicking', - 'DragAndDropTest.testDragTooFar', - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=374 - 'ElementFindingTest.testShouldNotBeAbleToFindAnElementOnABlankPage', - 'ExecutingAsyncJavascriptTest.includesAlertTextInUnhandledAlertException', - 'ExecutingAsyncJavascriptTest.shouldCatchErrorsWithMessageAndStacktraceWhenExecutingInitialScript', - 'ExecutingAsyncJavascriptTest.throwsIfAlertHappensDuringScript', - 'ExecutingAsyncJavascriptTest.throwsIfAlertHappensDuringScriptWhichTimesOut', - 'ExecutingAsyncJavascriptTest.throwsIfScriptTriggersAlert', - 'ExecutingAsyncJavascriptTest.throwsIfScriptTriggersAlertWhichTimesOut', - 'ExecutingJavascriptTest.testShouldThrowExceptionIfExecutingOnNoPage', - 'ExecutingJavascriptTest.testShouldThrowAnExceptionWithMessageAndStacktraceWhenTheJavascriptIsBad', - 'FormHandlingTest.testShouldNotBeAbleToSubmitAFormThatDoesNotExist', - 'FrameSwitchingTest.testShouldNotBeAbleToDoAnythingTheFrameIsDeletedFromUnderUs', - # Disabled until https://code.google.com/p/chromedriver/issues/detail?id=345 is fixed. - 'I18nTest.*', - 'I18nTest.testShouldBeAbleToActivateIMEEngine', - # Broken because AddWebStorage.java is broken. - 'LocalStorageTest.*', - 'LocationContextTest.*', - 'MiscTest.testShouldBeAbleToGetTheSourceOfAnXmlDocument', - 'PageLoadingTest.shouldBeAbleToDisableAcceptOfInsecureSslCertsWithRequiredCapability', - 'PageLoadingTest.testShouldNotWaitIndefinitelyIfAnExternalResourceFailsToLoad', - # PerformanceLoggingTest is for firefox only; "performance" log deprecated. - 'PerformanceLoggingTest.*', - 'ProxySettingTest.canConfigureProxyWithRequiredCapability', - 'ProxySettingTest.requiredProxyCapabilityShouldHavePriority', - 'RenderedWebElementTest.testShouldHandleNonIntegerPositionAndSize', - # Broken because AddWebStorage.java is broken. - 'SessionStorageTest.*', - 'SqlDatabaseTest.*', - 'SvgDocumentTest.testClickOnSvgElement', - 'TakesScreenshotTest.testShouldCaptureScreenshot', - 'TakesScreenshotTest.testShouldCaptureScreenshotAtIFramePage', - 'TakesScreenshotTest.testShouldCaptureScreenshotWithLongX', - 'TakesScreenshotTest.testShouldCaptureScreenshotWithLongY', - 'TakesScreenshotTest.testShouldCaptureScreenshotWithTooLong', - 'TakesScreenshotTest.testShouldCaptureScreenshotWithTooLongX', - 'TakesScreenshotTest.testShouldCaptureScreenshotWithTooLongY', - 'TextHandlingTest.testShouldNotReturnLtrMarks', - 'TextPagesTest.testShouldBeAbleToLoadASimplePageOfText', - 'TextPagesTest.testShouldThrowExceptionWhenAddingCookieToAPageThatIsNotHtml', - 'TypingTest.testGenerateKeyPressEventEvenWhenElementPreventsDefault', - 'TypingTest.testNonPrintableCharactersShouldWorkWithContentEditableOrDesignModeSet', - 'TypingTest.testShouldBeAbleToTypeIntoContentEditableElementWithExistingValue', - 'TypingTest.testShouldNotTypeIntoElementsThatPreventKeyDownEvents', - 'TypingTest.testTypingIntoAnIFrameWithContentEditableOrDesignModeSet', - 'UnexpectedAlertBehaviorTest.*', - 'VisibilityTest.testElementHiddenByOverflowXIsNotVisible', - 'VisibilityTest.testElementHiddenByOverflowYIsNotVisible', - 'VisibilityTest.tooSmallAWindowWithOverflowHiddenIsNotAProblem', - 'WindowTest.*', - # https://code.google.com/p/chromedriver/issues/detail?id=412 - 'ClickTest.testCanClickOnAnElementWithTopSetToANegativeNumber', - 'ClickTest.testShouldBeAbleToClickOnAnElementInTheViewport', - 'ExecutingAsyncJavascriptTest.shouldBeAbleToExecuteAsynchronousScripts', - 'FormHandlingTest.testShouldClickOnSubmitInputElements', - 'FrameSwitchingTest.testShouldBeAbleToClickInAFrame', - 'FrameSwitchingTest.testShouldBeAbleToSwitchToTheTopIfTheFrameIsDeletedFromUnderUs', - 'FrameSwitchingTest.testShouldAllowTheUserToSwitchToAnIFrameAndRemainFocusedOnIt', - 'FrameSwitchingTest.testShouldBeAbleToClickInASubFrame', - 'FrameSwitchingTest.testShouldNotSwitchMagicallyToTheTopWindow', - 'ImplicitWaitTest.testShouldImplicitlyWaitUntilAtLeastOneElementIsFoundWhenSearchingForMany', - 'ImplicitWaitTest.testShouldImplicitlyWaitForAnElementToBeVisibleBeforeInteracting', - 'ImplicitWaitTest.testShouldReturnAfterFirstAttemptToFindManyAfterDisablingImplicitWaits', - 'ImplicitWaitTest.testShouldImplicitlyWaitForASingleElement', - 'XPathElementFindingTest.testShouldBeAbleToSearchForMultipleAttributes', -] - - -_OS_NEGATIVE_FILTER = {} -_OS_NEGATIVE_FILTER['win'] = [ - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=282 - 'PageLoadingTest.testShouldNotHangIfDocumentOpenCallIsNeverFollowedByDocumentCloseCall', - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=373 - 'RenderedWebElementTest.testHoverPersists', - 'RenderedWebElementTest.canClickOnASuckerFishStyleMenu', - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=416 - 'TakesScreenshotTest.testShouldCaptureScreenshotAtIFramePageAfterSwitching', - 'TakesScreenshotTest.testShouldCaptureScreenshotAtFramePage', -] -_OS_NEGATIVE_FILTER['linux'] = [] -_OS_NEGATIVE_FILTER['mac'] = [ - # https://code.google.com/p/chromedriver/issues/detail?id=26 - 'AlertsTest.testAlertShouldNotAllowAdditionalCommandsIfDismissed', - 'AlertsTest.testShouldAllowUsersToDismissAnAlertManually', - 'FormHandlingTest.handleFormWithJavascriptAction', - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=354 - 'AlertsTest.testShouldAllowUsersToAcceptAnAlertInAFrame', - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=375 - 'PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes', -] -_OS_NEGATIVE_FILTER['android'] = [ - 'ChromeOptionsFunctionalTest.canStartChromeWithCustomOptions', - 'ClickScrollingTest.testShouldBeAbleToClickElementThatIsOutOfViewInANestedFrame', - 'ClickScrollingTest.testShouldBeAbleToClickElementThatIsOutOfViewInANestedFrameThatIsOutOfView', - 'ClickTest.testShouldOnlyFollowHrefOnce', - 'CombinedInputActionsTest.testCombiningShiftAndClickResultsInANewWindow', - 'ElementSelectingTest.testShouldBeAbleToToggleEnabledMultiSelectOption', - 'FrameSwitchingTest.testShouldBeAbleToClickInAFrameThatRewritesTopWindowLocation', - 'JavascriptEnabledDriverTest.testShouldBeAbleToClickALinkThatClosesAWindow', - 'PageLoadingTest.testShouldBeAbleToAccessPagesWithAnInsecureSslCertificate', - 'PageLoadingTest.testShouldBeAbleToAccessPagesWithAnInsecureSslCertificate', - 'PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistoryInPresenceOfIframes', - 'PageLoadingTest.testShouldFollowMetaRedirects', - 'PageLoadingTest.testShouldWaitForDocumentToBeLoaded', - 'PerformanceLogTypeTest.pageLoadShouldProducePerformanceLogEntries', - 'PerformanceLogTypeTest.shouldBeAbleToEnablePerformanceLog', - 'SelectElementHandlingTest.testShouldBePossibleToDeselectASingleOptionFromASelectWhichAllowsMultipleChoices', - 'SelectElementTest.shouldAllowOptionsToBeDeselectedByIndex', - 'SelectElementTest.shouldAllowOptionsToBeDeselectedByReturnedValue', - 'SelectElementTest.shouldAllowUserToDeselectAllWhenSelectSupportsMultipleSelections', - 'SelectElementTest.shouldAllowUserToDeselectOptionsByVisibleText', - 'SessionHandlingTest.callingAnyOperationAfterClosingTheLastWindowShouldThrowAnException', - 'SessionHandlingTest.callingQuitAfterClosingTheLastWindowIsANoOp', - 'TakesScreenshotTest.testCaptureToBase64', - 'TakesScreenshotTest.testSaveScreenshotAsFile', - 'TakesScreenshotTest.testShouldCaptureScreenshotAtFramePage', - 'TakesScreenshotTest.testShouldCaptureScreenshotAtFramePageAfterSwitching', - 'TakesScreenshotTest.testShouldCaptureScreenshotAtIFramePageAfterSwitching', - - # Alerts are not yet supported on Android. - 'AlertsTest.*', - - # http://crbug.com/156390 - 'DragAndDropTest.*', - - # Touch events are not yet supported. - 'TouchFlickTest.*', - 'TouchScrollTest.*', - 'TouchSingleTapTest.*', - - # These tests start multiple sessions, which is not supported on a single - # Android device. - "AvailableLogsTest.shouldBeAbleToEnableProfilerLog", - "GetLogsTest.turningOffLogShouldMeanNoLogMessages", - "SessionHandlingTest.callingAnyOperationAfterQuitShouldThrowAnException", - "SessionHandlingTest.callingQuitMoreThanOnceOnASessionIsANoOp", - # Test is written using local files; doesn't work on Android. - 'UploadTest.testFileUploading', - # Not applicable on Chromium Test Shell (doesn't support tabs). - 'WindowSwitchingTest.*', - - # Flaky: https://code.google.com/p/chromedriver/issues/detail?id=441 - 'PageLoadingTest.testShouldBeAbleToNavigateBackInTheBrowserHistory', -] - - -def _GetRevisionNegativeFilter(chrome_version): - if chrome_version in _REVISION_NEGATIVE_FILTER: - return _REVISION_NEGATIVE_FILTER[chrome_version] - return _REVISION_NEGATIVE_FILTER['HEAD'] - - -def GetDisabledTestMatchers(operating_system, chrome_version): - """Returns the list of disabled test matchers for the specific configuration. - - Args: - operating_system: The operating system, one of 'linux', 'mac', 'win', or - 'android'. - chrome_version: Chrome version to test against, e.g., 'HEAD' or '26'. - - Returns: - List of disabled test matchers, which may contain '*' wildcards. - """ - return (_OS_NEGATIVE_FILTER[operating_system] + - _GetRevisionNegativeFilter(chrome_version))[:] - - -def ApplyJavaTestFilter(operating_system, chrome_version, tests): - """Applies the test filter to the given list of tests. - - Args: - operating_system: The operating system, one of 'linux', 'mac', 'win', or - 'android'. - chrome_version: Chrome version to test against, e.g., 'HEAD' or '26'. - test: list of test names to filter. - - Returns: - Set of passed test names. - """ - filters = (_OS_NEGATIVE_FILTER[operating_system] + - _GetRevisionNegativeFilter(chrome_version)) - passed = set(tests) - for f in filters: - passed.difference_update(set(t for t in tests if fnmatch.fnmatch(t, f))) - return passed |