Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1753)

Unified Diff: Tools/Scripts/webkitpy/layout_tests/port/factory.py

Issue 378113003: Modifications to layout test framework so that it can work with browser_tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed get_port_class_name() override. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Tools/Scripts/webkitpy/layout_tests/port/factory.py
diff --git a/Tools/Scripts/webkitpy/layout_tests/port/factory.py b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
index db2144ba2c03d6948db46d38da0bc8bcfef759ab..8703ddf3d3e612488820f5b68293557da895d2c7 100644
--- a/Tools/Scripts/webkitpy/layout_tests/port/factory.py
+++ b/Tools/Scripts/webkitpy/layout_tests/port/factory.py
@@ -104,13 +104,22 @@ class PortFactory(object):
if port_name == 'chromium':
port_name = self._host.platform.os_name
- for port_class in self.PORT_CLASSES:
- module_name, class_name = port_class.rsplit('.', 1)
+ if 'browser_test' in port_name:
+ module_name, class_name = port_name.rsplit('.', 1)
module = __import__(module_name, globals(), locals(), [], -1)
- cls = module.__dict__[class_name]
- if port_name.startswith(cls.port_name):
- port_name = cls.determine_full_port_name(self._host, options, port_name)
+ port_class_name = module.get_port_class_name(class_name)
+ if port_class_name != None:
+ cls = module.__dict__[port_class_name]
+ port_name = cls.determine_full_port_name(self._host, options, class_name)
return cls(self._host, port_name, options=options, **kwargs)
+ else:
+ for port_class in self.PORT_CLASSES:
+ module_name, class_name = port_class.rsplit('.', 1)
+ module = __import__(module_name, globals(), locals(), [], -1)
+ cls = module.__dict__[class_name]
+ if port_name.startswith(cls.port_name):
+ port_name = cls.determine_full_port_name(self._host, options, port_name)
+ return cls(self._host, port_name, options=options, **kwargs)
raise NotImplementedError('unsupported platform: "%s"' % port_name)
def all_port_names(self, platform=None):

Powered by Google App Engine
This is Rietveld 408576698