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

Unified Diff: chrome/common/extensions/docs/server2/chrome_version_utility_test.py

Issue 12996003: Dynamically generate a heading for Extension Docs API pages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Finding earliest 'stable' availability using features files Created 7 years, 8 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
Index: chrome/common/extensions/docs/server2/chrome_version_utility_test.py
diff --git a/chrome/common/extensions/docs/server2/chrome_version_utility_test.py b/chrome/common/extensions/docs/server2/chrome_version_utility_test.py
new file mode 100755
index 0000000000000000000000000000000000000000..51bec1793be95531e2d2b17d084f1568fcad869e
--- /dev/null
+++ b/chrome/common/extensions/docs/server2/chrome_version_utility_test.py
@@ -0,0 +1,53 @@
+#!/usr/bin/env python
+# Copyright (c) 2013 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.
+
+import os
+import sys
+import unittest
+
+from chrome_version_utility import ChromeVersionUtility
+from fake_url_fetcher import FakeUrlFetcher
+from object_store_creator import ObjectStoreCreator
+
+class ChromeVersionUtilityTest(unittest.TestCase):
+ def setUp(self):
+ self._chrome_version_util = ChromeVersionUtility(
+ os.path.join('chrome_version_utility', 'omaha_dev_win_history.json'),
+ FakeUrlFetcher(os.path.join(sys.path[0], 'test_data')),
+ ObjectStoreCreator.TestFactory())
+
+ def testGetLatestVersionNumber(self):
+ self.assertEquals(28, self._chrome_version_util.GetLatestVersionNumber())
+
+ def testGetBranchNumberForVersion(self):
+ self.assertEquals('1453',
+ self._chrome_version_util.GetBranchNumberForVersion('27'))
+ self.assertEquals('1410',
+ self._chrome_version_util.GetBranchNumberForVersion('26'))
+ self.assertEquals('1364',
+ self._chrome_version_util.GetBranchNumberForVersion('25'))
+ self.assertEquals('1312',
+ self._chrome_version_util.GetBranchNumberForVersion('24'))
+ self.assertEquals('1271',
+ self._chrome_version_util.GetBranchNumberForVersion('23'))
+ self.assertEquals('1229',
+ self._chrome_version_util.GetBranchNumberForVersion('22'))
+ self.assertEquals('1180',
+ self._chrome_version_util.GetBranchNumberForVersion('21'))
+ self.assertEquals('1132',
+ self._chrome_version_util.GetBranchNumberForVersion('20'))
+ self.assertEquals('1084',
+ self._chrome_version_util.GetBranchNumberForVersion('19'))
+ self.assertEquals('1025',
+ self._chrome_version_util.GetBranchNumberForVersion('18'))
+ self.assertEquals('963',
+ self._chrome_version_util.GetBranchNumberForVersion('17'))
+ self.assertEquals('696',
+ self._chrome_version_util.GetBranchNumberForVersion('11'))
+ self.assertEquals('396',
+ self._chrome_version_util.GetBranchNumberForVersion('5'))
+
+if __name__ == '__main__':
+ unittest.main()

Powered by Google App Engine
This is Rietveld 408576698