本文整理汇总了Python中webkitpy.common.net.layouttestresults.LayoutTestResults类的典型用法代码示例。如果您正苦于以下问题:Python LayoutTestResults类的具体用法?Python LayoutTestResults怎么用?Python LayoutTestResults使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LayoutTestResults类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_results
def test_results(self):
# Doesn't make sense to ask for the test_results until the tests have run at least once.
assert(self._test_run_counter >= 0)
failures_for_run = self._test_failure_plan[self._test_run_counter]
results = LayoutTestResults(map(self._mock_test_result, failures_for_run))
# This makes the results trustable by ExpectedFailures.
results.set_failure_limit_count(10)
return results
示例2: test_was_interrupted
def test_was_interrupted(self):
self.assertTrue(
LayoutTestResults.results_from_string('ADD_RESULTS({"tests":{},"interrupted":true});').run_was_interrupted()
)
self.assertFalse(
LayoutTestResults.results_from_string(
'ADD_RESULTS({"tests":{},"interrupted":false});'
).run_was_interrupted()
)
示例3: builder_data
def builder_data():
old_builder_data()
# have prototype-chocolate only fail on "MOCK Leopard".
self.command._builder_data['MOCK SnowLeopard'] = LayoutTestResults.results_from_string("""ADD_RESULTS({
"tests": {
"fast": {
"dom": {
"prototype-taco.html": {
"expected": "PASS",
"actual": "PASS TEXT",
"is_unexpected": true
},
"prototype-chocolate.html": {
"expected": "FAIL",
"actual": "PASS"
},
"prototype-strawberry.html": {
"expected": "PASS",
"actual": "IMAGE PASS",
"is_unexpected": true
}
}
}
}
});""")
return self.command._builder_data
示例4: test_parse_layout_test_results
def test_parse_layout_test_results(self):
failures = [test_failures.FailureMissingResult(), test_failures.FailureMissingImageHash(), test_failures.FailureMissingImage()]
testname = 'fast/repaint/no-caret-repaint-in-non-content-editable-element.html'
expected_results = [test_results.TestResult(testname, failures)]
results = LayoutTestResults._parse_results_html(self._example_results_html)
self.assertEqual(expected_results, results)
示例5: fetch_layout_test_results
def fetch_layout_test_results(self, results_url):
# FIXME: This should cache that the result was a 404 and stop hitting the network.
results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "full_results.json"))
if not results_file:
results_file = NetworkTransaction(convert_404_to_None=True).run(lambda: self._fetch_file_from_results(results_url, "results.html"))
# results_from_string accepts either ORWT html or NRWT json.
return LayoutTestResults.results_from_string(results_file)
示例6: fetch_layout_test_results
def fetch_layout_test_results(self, results_url):
"""Returns a LayoutTestResults object for results fetched from a given URL."""
results_file = NetworkTransaction(convert_404_to_None=True).run(
lambda: self._fetch_file(results_url, "failing_results.json"))
revision = NetworkTransaction(convert_404_to_None=True).run(
lambda: self._fetch_file(results_url, "LAST_CHANGE"))
if not revision:
results_file = None
return LayoutTestResults.results_from_string(results_file, revision)
示例7: test_unexpected_mismatch_results
def test_unexpected_mismatch_results(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
self.assertEqual(
[r.test_name() for r in results.unexpected_mismatch_results()],
[
'fast/dom/prototype-inheritance.html',
'fast/dom/prototype-taco.html',
'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html'
])
示例8: test_didnt_run_as_expected_results
def test_didnt_run_as_expected_results(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
self.assertEqual(
[r.test_name() for r in results.didnt_run_as_expected_results()],
[
'fast/dom/prototype-banana.html',
'fast/dom/prototype-crashy.html',
'fast/dom/prototype-inheritance.html',
'fast/dom/prototype-newtest.html',
'fast/dom/prototype-strawberry.html',
'fast/dom/prototype-taco.html',
'svg/dynamic-updates/SVGFEDropShadowElement-dom-stdDeviation-attr.html',
])
示例9: _setup_mock_builder_data
def _setup_mock_builder_data(self):
data = LayoutTestResults.results_from_string("""ADD_RESULTS({
"tests": {
"userscripts": {
"first-test.html": {
"expected": "PASS",
"actual": "IMAGE+TEXT"
},
"second-test.html": {
"expected": "FAIL",
"actual": "IMAGE+TEXT"
}
}
}
});""")
for builder in ['MOCK builder', 'MOCK builder (Debug)', 'WebKit Mac10.7']:
self.command._builder_data[builder] = data
示例10: test_results_from_string
def test_results_from_string(self):
self.assertIsNone(LayoutTestResults.results_from_string(None))
self.assertIsNone(LayoutTestResults.results_from_string(""))
示例11: _create_layout_test_results
def _create_layout_test_results(self):
results_path = self._tool.port().layout_tests_results_path()
results_html = self._read_file_contents(results_path)
if not results_html:
return None
return LayoutTestResults.results_from_string(results_html)
示例12: test_results_from_string
def test_results_from_string(self):
self.assertEqual(LayoutTestResults.results_from_string(None), None)
self.assertEqual(LayoutTestResults.results_from_string(""), None)
示例13: layout_test_results
def layout_test_results(self):
if not self._layout_test_results:
# FIXME: This should cache that the result was a 404 and stop hitting the network.
self._layout_test_results = LayoutTestResults.results_from_string(self._fetch_results_html())
return self._layout_test_results
示例14: latest_layout_test_results
def latest_layout_test_results(self):
return LayoutTestResults.results_from_string(layouttestresults_unittest.LayoutTestResultsTest.example_full_results_json)
示例15: test_missing_baseline
def test_missing_baseline(self):
results = LayoutTestResults.results_from_string(self.example_full_results_json)
missing_results = results.missing_results()
self.assertEqual(len(missing_results), 1)
self.assertEqual(missing_results[0].test_name(), "fast/dom/prototype-newtest.html")