summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbokan <bokan@chromium.org>2016-03-08 17:40:42 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-09 01:41:51 +0000
commit415a07cad061c246021d563fc5bd840cb4646512 (patch)
tree2cf8a4330e5257868f8fc1428364b13cc9bd2902
parent4e723b20b3c64ff2deb324b463c35be1a2e9478f (diff)
downloadchromium_src-415a07cad061c246021d563fc5bd840cb4646512.zip
chromium_src-415a07cad061c246021d563fc5bd840cb4646512.tar.gz
chromium_src-415a07cad061c246021d563fc5bd840cb4646512.tar.bz2
Fixed circular module dependencies in webkitpy
In particular, importing subclasses in port's __init__.py while having other places import those classes directly meant we'd get a circular dependency when import with the full class' path before the module is initialized. This mainly manifested when trying to run tests using test-webkitpy. Running all the tests was fine since the modules got loaded (likely by accident) in the right order but some tests wouldn't run standalone. I've removed all the imports in port/__init__.py and replaced the relevant imports with the full dotted path. BUG= Review URL: https://codereview.chromium.org/1780533003 Cr-Commit-Position: refs/heads/master@{#380020}
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py2
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/__init__.py36
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py4
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py3
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py3
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/test.py4
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_times.py2
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py2
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py2
-rw-r--r--third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py2
10 files changed, 14 insertions, 46 deletions
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py
index 8631e3e..f26f3f7 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/lint_test_expectations.py
@@ -34,7 +34,7 @@ import traceback
from webkitpy.common.host import Host
from webkitpy.layout_tests.models import test_expectations
-from webkitpy.layout_tests.port import platform_options
+from webkitpy.layout_tests.port.factory import platform_options
# This mirrors what the shell normally does.
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/__init__.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/__init__.py
index cc7fa86..ef65bee 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/__init__.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/__init__.py
@@ -1,35 +1 @@
-# Copyright (C) 2010 Google Inc. All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are
-# met:
-#
-# * Redistributions of source code must retain the above copyright
-# notice, this list of conditions and the following disclaimer.
-# * Redistributions in binary form must reproduce the above
-# copyright notice, this list of conditions and the following disclaimer
-# in the documentation and/or other materials provided with the
-# distribution.
-# * Neither the name of Google Inc. nor the names of its
-# contributors may be used to endorse or promote products derived from
-# this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
-"""Port-specific entrypoints for the layout tests test infrastructure."""
-
-import builders # Why is this in port?
-
-from base import Port # It's possible we don't need to export this virtual baseclass outside the module.
-from driver import DeviceFailure, Driver, DriverInput, DriverOutput
-from factory import platform_options, configuration_options
+# Required for Python to search this directory for module files
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
index 26399ef..2ac11cc 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/base_unittest.py
@@ -42,8 +42,8 @@ from webkitpy.common.system.executive_mock import MockExecutive, MockExecutive2
from webkitpy.common.system.systemhost import SystemHost
from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import Port, Driver, DriverOutput
-from webkitpy.layout_tests.port.base import VirtualTestSuite
+from webkitpy.layout_tests.port.driver import Driver, DriverOutput
+from webkitpy.layout_tests.port.base import Port, VirtualTestSuite
from webkitpy.layout_tests.port.test import add_unit_tests_to_mock_filesystem, TestPort
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py
index e24e738..576e0b0 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/browser_test_driver_unittest.py
@@ -30,7 +30,8 @@ import unittest
from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import Port, Driver, DriverOutput
+from webkitpy.layout_tests.port.base import Port
+from webkitpy.layout_tests.port.driver import Driver, DriverOutput
from webkitpy.layout_tests.port import browser_test, browser_test_driver
from webkitpy.layout_tests.port.server_process_mock import MockServerProcess
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
index 67d58d6..5ee69e0 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/driver_unittest.py
@@ -30,7 +30,8 @@ import unittest
from webkitpy.common.system.systemhost_mock import MockSystemHost
-from webkitpy.layout_tests.port import Port, Driver, DriverOutput
+from webkitpy.layout_tests.port.base import Port
+from webkitpy.layout_tests.port.driver import Driver, DriverOutput
from webkitpy.layout_tests.port.server_process_mock import MockServerProcess
# FIXME: remove the dependency on TestWebKitPort
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/test.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/test.py
index 3d22fee..b82e96f 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/test.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/port/test.py
@@ -31,8 +31,8 @@ import copy
import sys
import time
-from webkitpy.layout_tests.port import DeviceFailure, Driver, DriverOutput, Port
-from webkitpy.layout_tests.port.base import VirtualTestSuite
+from webkitpy.layout_tests.port.base import Port, VirtualTestSuite
+from webkitpy.layout_tests.port.driver import DeviceFailure, Driver, DriverOutput
from webkitpy.layout_tests.models.test_configuration import TestConfiguration
from webkitpy.layout_tests.models import test_run_results
from webkitpy.common.system.filesystem_mock import MockFileSystem
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_times.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_times.py
index ee55d0e..442ac84 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_times.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/print_layout_test_times.py
@@ -30,7 +30,7 @@ import json
import optparse
from webkitpy.layout_tests.layout_package.json_results_generator import convert_times_trie_to_flat_paths
-from webkitpy.layout_tests.port import Port
+from webkitpy.layout_tests.port.base import Port
def main(host, argv):
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
index 2259ed6..8684a56 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests.py
@@ -38,7 +38,7 @@ from webkitpy.common.host import Host
from webkitpy.common.system.executive import Executive
from webkitpy.layout_tests.controllers.manager import Manager
from webkitpy.layout_tests.models import test_run_results
-from webkitpy.layout_tests.port import configuration_options, platform_options
+from webkitpy.layout_tests.port.factory import configuration_options, platform_options
from webkitpy.layout_tests.views import buildbot_results
from webkitpy.layout_tests.views import printing
from webkitpy.layout_tests.generate_results_dashboard import DashBoardGenerator
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
index 830f972..79863db 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/run_webkit_tests_unittest.py
@@ -51,8 +51,8 @@ from webkitpy.common.host_mock import MockHost
from webkitpy.layout_tests import port
from webkitpy.layout_tests import run_webkit_tests
from webkitpy.layout_tests.models import test_run_results
-from webkitpy.layout_tests.port import Port
from webkitpy.layout_tests.port import test
+from webkitpy.layout_tests.port.base import Port
from webkitpy.tool import grammar
from webkitpy.tool.mocktool import MockOptions
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py
index 7d2f3f56..42beb12 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/tool/commands/queries.py
@@ -37,7 +37,7 @@ from optparse import make_option
from webkitpy.common.system.crashlogs import CrashLogs
from webkitpy.tool.multicommandtool import AbstractDeclarativeCommand
from webkitpy.layout_tests.models.test_expectations import TestExpectations
-from webkitpy.layout_tests.port import platform_options
+from webkitpy.layout_tests.port.factory import platform_options
_log = logging.getLogger(__name__)