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

Side by Side 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: Fixing up Offline/Online Access - Attempting to rework availability algorithm Created 7 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 unified diff | Download patch
OLDNEW
(Empty)
1 #!/usr/bin/env python
2 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
5
6 import os
7 import sys
8 import unittest
9
10 from chrome_version_utility import ChromeVersionUtility
11 from fake_url_fetcher import FakeUrlFetcher
12 from object_store_creator import ObjectStoreCreator
13
14 class ChromeVersionUtilityTest(unittest.TestCase):
15 def setUp(self):
16 self._chrome_version_util = ChromeVersionUtility(
17 os.path.join('chrome_version_utility', 'omaha_dev_win_history.json'),
18 FakeUrlFetcher(os.path.join(sys.path[0], 'test_data')),
19 ObjectStoreCreator.ForTest())
20
21 def testGetLatestVersionNumber(self):
22 self.assertEquals(28, self._chrome_version_util.GetLatestVersionNumber())
23
24 def testGetBranchNumberForVersion(self):
25 self.assertEquals(1453,
26 self._chrome_version_util.GetBranchNumberForVersion(27))
27 self.assertEquals(1410,
28 self._chrome_version_util.GetBranchNumberForVersion(26))
29 self.assertEquals(1364,
30 self._chrome_version_util.GetBranchNumberForVersion(25))
31 self.assertEquals(1312,
32 self._chrome_version_util.GetBranchNumberForVersion(24))
33 self.assertEquals(1271,
34 self._chrome_version_util.GetBranchNumberForVersion(23))
35 self.assertEquals(1229,
36 self._chrome_version_util.GetBranchNumberForVersion(22))
37 self.assertEquals(1180,
38 self._chrome_version_util.GetBranchNumberForVersion(21))
39 self.assertEquals(1132,
40 self._chrome_version_util.GetBranchNumberForVersion(20))
41 self.assertEquals(1084,
42 self._chrome_version_util.GetBranchNumberForVersion(19))
43 self.assertEquals(1025,
44 self._chrome_version_util.GetBranchNumberForVersion(18))
45 self.assertEquals(963,
46 self._chrome_version_util.GetBranchNumberForVersion(17))
47 self.assertEquals(696,
48 self._chrome_version_util.GetBranchNumberForVersion(11))
49 self.assertEquals(396,
50 self._chrome_version_util.GetBranchNumberForVersion(5))
51
52 if __name__ == '__main__':
53 unittest.main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698