From 908d3ffedf2d7fd1ac38c59bae36f96535f86308 Mon Sep 17 00:00:00 2001 From: Mark Striemer Date: Wed, 28 Jan 2015 15:45:07 -0600 Subject: [PATCH] nsIBoxObject changes (bug 1122229) --- tests/compat/test_gecko35.py | 52 ++++++++++++++++++++++++++++++++++++ validator/testcases/regex.py | 22 ++++++++++++++- 2 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 tests/compat/test_gecko35.py diff --git a/tests/compat/test_gecko35.py b/tests/compat/test_gecko35.py new file mode 100644 index 000000000..a3daa0113 --- /dev/null +++ b/tests/compat/test_gecko35.py @@ -0,0 +1,52 @@ +from helper import CompatTestCase +from validator.compat import FX35_DEFINITION + + +class TestFX35Compat(CompatTestCase): + """Test that compatibility tests for Gecko 35 are properly executed.""" + + VERSION = FX35_DEFINITION + + def nsIBoxObject_changed(self, interface): + self.run_script_for_compat(""" + var obj = Components.interfaces.{interface}; + """.format(interface=interface)) + self.assert_silent() + self.assert_compat_error() + + def test_nsIBoxObject_changed(self): + self.nsIBoxObject_changed('nsIBoxObject') + + def test_nsIBrowserBoxObject_changed(self): + self.nsIBoxObject_changed('nsIBrowserBoxObject') + + def test_nsIContainerBoxObject_changed(self): + self.nsIBoxObject_changed('nsIContainerBoxObject') + + def test_nsIEditorBoxObject_changed(self): + self.nsIBoxObject_changed('nsIEditorBoxObject') + + def test_nsIIFrameBoxObject_changed(self): + self.nsIBoxObject_changed('nsIIFrameBoxObject') + + def test_nsIListBoxObject_changed(self): + self.nsIBoxObject_changed('nsIListBoxObject') + + def test_nsIMenuBoxObject_changed(self): + self.nsIBoxObject_changed('nsIMenuBoxObject') + + def test_nsIPopupBoxObject_changed(self): + self.nsIBoxObject_changed('nsIPopupBoxObject') + + def test_nsIScrollBoxObject_changed(self): + self.nsIBoxObject_changed('nsIScrollBoxObject') + + def test_nsITreeBoxObject_changed(self): + self.nsIBoxObject_changed('nsITreeBoxObject') + + def test_nsIFoo_BoxObject_no_error(self): + self.run_script_for_compat(""" + var nsIFoo = myBoxObject; + """) + self.assert_silent() + self.assert_compat_silent() diff --git a/validator/testcases/regex.py b/validator/testcases/regex.py index 4fa45d008..e05edb475 100644 --- a/validator/testcases/regex.py +++ b/validator/testcases/regex.py @@ -9,7 +9,7 @@ FX18_DEFINITION, FX19_DEFINITION, FX20_DEFINITION, FX21_DEFINITION, FX22_DEFINITION, FX23_DEFINITION, FX24_DEFINITION, FX25_DEFINITION, FX26_DEFINITION, FX27_DEFINITION, FX28_DEFINITION, FX30_DEFINITION, - FX31_DEFINITION, FX32_DEFINITION, FX34_DEFINITION, + FX31_DEFINITION, FX32_DEFINITION, FX34_DEFINITION, FX35_DEFINITION, TB7_DEFINITION, TB10_DEFINITION, TB11_DEFINITION, TB12_DEFINITION, TB13_DEFINITION, TB14_DEFINITION, TB15_DEFINITION, TB16_DEFINITION, TB17_DEFINITION, TB18_DEFINITION, TB19_DEFINITION, TB20_DEFINITION, @@ -1516,6 +1516,26 @@ def tests(self): compat_type="error") +@register_generator +class Gecko35RegexTests(CompatRegexTestHelper): + """Regex tests for Gecko 35 updates.""" + + VERSION = FX35_DEFINITION + + def tests(self): + box_object_subject = ("All interfaces derived from nsIBoxObject no " + "longer exist.") + yield self.get_test( + r"\bnsI\w*BoxObject\b", + box_object_subject, + box_object_subject + " If you use them with " + "QueryInterface it's likely you just need to remove " + "the function call. See %s for more information." + % BUGZILLA_BUG % 979835, + log_function=self.err.warning, + compat_type="error") + + ############################# # Thunderbird Regex Tests # #############################