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

Unified Diff: chrome/browser/web_dev_style/resource_checker_test.py

Issue 2890513003: Move chrome/browser/web_dev_style/ to tools/ to use from more places (Closed)
Patch Set: tsergeant@ review Created 3 years, 7 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
« no previous file with comments | « chrome/browser/web_dev_style/resource_checker.py ('k') | chrome/browser/web_dev_style/test_util.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/web_dev_style/resource_checker_test.py
diff --git a/chrome/browser/web_dev_style/resource_checker_test.py b/chrome/browser/web_dev_style/resource_checker_test.py
deleted file mode 100755
index d16f556bc9ce515fcba9f12693bde9d67c588f06..0000000000000000000000000000000000000000
--- a/chrome/browser/web_dev_style/resource_checker_test.py
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-from os import path as os_path
-import re
-import resource_checker
-from sys import path as sys_path
-import test_util
-import unittest
-
-_HERE = os_path.dirname(os_path.abspath(__file__))
-sys_path.append(os_path.join(_HERE, '..', '..', '..', 'build'))
-
-import find_depot_tools # pylint: disable=W0611
-from testing_support.super_mox import SuperMoxTestBase
-
-
-class ResourceCheckerTest(SuperMoxTestBase):
- def setUp(self):
- SuperMoxTestBase.setUp(self)
-
- input_api = self.mox.CreateMockAnything()
- input_api.re = re
- output_api = self.mox.CreateMockAnything()
- self.checker = resource_checker.ResourceChecker(input_api, output_api)
-
- def ShouldFailIncludeCheck(self, line):
- """Checks that the '</include>' checker flags |line| as a style error."""
- error = self.checker.IncludeCheck(1, line)
- self.assertNotEqual('', error,
- 'Should be flagged as style error: ' + line)
- highlight = test_util.GetHighlight(line, error).strip()
- self.assertTrue('include' in highlight and highlight[0] == '<')
-
- def ShouldPassIncludeCheck(self, line):
- """Checks that the '</include>' checker doesn't flag |line| as an error."""
- self.assertEqual('', self.checker.IncludeCheck(1, line),
- 'Should not be flagged as style error: ' + line)
-
- def testIncludeFails(self):
- lines = [
- "</include> ",
- " </include>",
- " </include> ",
- ' <include src="blah.js" /> ',
- '<include src="blee.js"/>',
- ]
- for line in lines:
- self.ShouldFailIncludeCheck(line)
-
- def testIncludePasses(self):
- lines = [
- '<include src="assert.js">',
- "<include src='../../assert.js'>",
- "<i>include src='blah'</i>",
- "</i>nclude",
- "</i>include",
- ]
- for line in lines:
- self.ShouldPassIncludeCheck(line)
-
-
-if __name__ == '__main__':
- unittest.main()
« no previous file with comments | « chrome/browser/web_dev_style/resource_checker.py ('k') | chrome/browser/web_dev_style/test_util.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698