Commit ab71188e authored by Alex Catarineu's avatar Alex Catarineu
Browse files

Fix dom objects enumeration tests for 80

parent 5c0a4650
import os
import json
from marionette_harness import MarionetteTestCase
class TestSuite(object):
def __init__(self):
......@@ -24,3 +25,9 @@ class TestSuite(object):
output = open(screenshot_file, 'w')
output.write(png_data)
output.close()
class TorBrowserTest(MarionetteTestCase):
def get_version(self):
with self.marionette.using_context("chrome"):
return self.marionette.execute_script("return parseFloat(AppConstants.MOZ_APP_VERSION);")
from marionette_harness import MarionetteTestCase
import testsuite
class Test(MarionetteTestCase):
class Test(testsuite.TorBrowserTest):
def setUp(self):
MarionetteTestCase.setUp(self)
testsuite.TorBrowserTest.setUp(self)
self.marionette.set_pref("network.proxy.allow_hijacking_localhost", False)
self.test_page_file_url = self.marionette.absolute_url("dom-objects-enumeration.html?testType=worker")
......@@ -196,8 +197,14 @@ class Test(MarionetteTestCase):
"XMLHttpRequestEventTarget",
"XMLHttpRequestUpload",
]
self.expectedObjects80 = self.expectedObjects + ["AggregateError", "FinalizationRegistry", "WeakRef"]
self.expectedObjects80.sort()
def test_dom_objects_enumeration_workers(self):
expectedObjects = self.expectedObjects
if self.get_version() >= 80:
expectedObjects = self.expectedObjects80
with self.marionette.using_context('content'):
self.marionette.navigate(self.test_page_file_url)
self.marionette.timeout.implicit = 5
......@@ -206,7 +213,7 @@ class Test(MarionetteTestCase):
err = False
unknown_objects = ''
for l in r:
if l in self.expectedObjects:
if l in expectedObjects:
continue
err = True
unknown_objects += l + "\n"
......@@ -214,7 +221,7 @@ class Test(MarionetteTestCase):
err_msg = "Unknown objects:\n%s" % unknown_objects
self.assertFalse(err, msg=err_msg)
for l in self.expectedObjects:
for l in expectedObjects:
if l in r:
continue
err = True
......
......@@ -8,10 +8,11 @@ from marionette_driver import By
from marionette_driver.errors import MarionetteException
from marionette_harness import MarionetteTestCase
import testsuite
class Test(MarionetteTestCase):
class Test(testsuite.TorBrowserTest):
def setUp(self):
MarionetteTestCase.setUp(self)
testsuite.TorBrowserTest.setUp(self)
self.marionette.set_pref("network.proxy.allow_hijacking_localhost", False)
self.test_page_file_url = self.marionette.absolute_url("dom-objects-enumeration.html?testType=window")
# The list of expected DOM objects
......@@ -753,8 +754,15 @@ class Test(MarionetteTestCase):
"XPathResult",
"XSLTProcessor",
]
self.expectedObjects80 = self.expectedObjects + ["AggregateError", "FinalizationRegistry", "WeakRef"]
self.expectedObjects80.remove("content")
self.expectedObjects80.sort()
def test_dom_objects_enumeration(self):
expectedObjects = self.expectedObjects
if self.get_version() >= 80:
expectedObjects = self.expectedObjects80
with self.marionette.using_context('content'):
self.marionette.navigate(self.test_page_file_url)
self.marionette.timeout.implicit = 5
......@@ -763,7 +771,7 @@ class Test(MarionetteTestCase):
err = False
unknown_objects = ''
for l in r:
if l in self.expectedObjects:
if l in expectedObjects:
continue
err = True
unknown_objects += l + "\n"
......@@ -771,7 +779,7 @@ class Test(MarionetteTestCase):
err_msg = "Unknown objects:\n%s" % unknown_objects
self.assertFalse(err, msg=err_msg)
for l in self.expectedObjects:
for l in expectedObjects:
if l in r:
continue
err = True
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment