Chromium Code Reviews| Index: tools/web_dev_style/js_checker_test.py |
| diff --git a/tools/web_dev_style/js_checker_test.py b/tools/web_dev_style/js_checker_test.py |
| index 72f99545b69028d16aa81b4ef78c2501635e71c1..428c78248865c7f0fe37de8913721115fb3b28ce 100755 |
| --- a/tools/web_dev_style/js_checker_test.py |
| +++ b/tools/web_dev_style/js_checker_test.py |
| @@ -203,49 +203,6 @@ class JsCheckerTest(SuperMoxTestBase): |
| for line in lines: |
| self.ShouldFailExtraDotInGenericCheck(line) |
| - def ShouldFailGetElementByIdCheck(self, line): |
|
Dan Beam
2017/05/30 16:17:26
can we leave some of these?
dpapad
2017/05/30 17:08:24
We would need to modify those tests to run self.ch
Dan Beam
2017/05/30 17:11:41
yes
dpapad
2017/05/30 18:30:15
Trying to address this comment, but I keep hitting
Dan Beam
2017/05/30 20:33:30
i think we should only use SuperMoxTestBase if it'
dpapad
2017/05/30 22:11:21
I am restoring similar tests at https://codereview
|
| - """Checks that the 'getElementById' checker flags |line| as a style |
| - error. |
| - """ |
| - error = self.checker.GetElementByIdCheck(1, line) |
| - self.assertNotEqual('', error, |
| - 'Should be flagged as style error: ' + line) |
| - self.assertEqual(test_util.GetHighlight(line, error), |
| - 'document.getElementById') |
| - |
| - def ShouldPassGetElementByIdCheck(self, line): |
| - """Checks that the 'getElementById' checker doesn't flag |line| as a style |
| - error. |
| - """ |
| - self.assertEqual('', self.checker.GetElementByIdCheck(1, line), |
| - 'Should not be flagged as style error: ' + line) |
| - |
| - def testGetElementByIdFails(self): |
| - lines = [ |
| - "document.getElementById('foo');", |
| - " document.getElementById('foo');", |
| - "var x = document.getElementById('foo');", |
| - "if (document.getElementById('foo').hidden) {", |
| - ] |
| - for line in lines: |
| - self.ShouldFailGetElementByIdCheck(line) |
| - |
| - def testGetElementByIdPasses(self): |
| - lines = [ |
| - "elem.ownerDocument.getElementById('foo');", |
| - " elem.ownerDocument.getElementById('foo');", |
| - "var x = elem.ownerDocument.getElementById('foo');", |
| - "if (elem.ownerDocument.getElementById('foo').hidden) {", |
| - "doc.getElementById('foo');", |
| - " doc.getElementById('foo');", |
| - "cr.doc.getElementById('foo');", |
| - " cr.doc.getElementById('foo');", |
| - "var x = doc.getElementById('foo');", |
| - "if (doc.getElementById('foo').hidden) {", |
| - ] |
| - for line in lines: |
| - self.ShouldPassGetElementByIdCheck(line) |
| - |
| def ShouldFailInheritDocCheck(self, line): |
| """Checks that the '@inheritDoc' checker flags |line| as a style error.""" |
| error = self.checker.InheritDocCheck(1, line) |