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

Unified Diff: tools/crx_id/crx_id_unittest.py

Issue 16346003: Fix extension id calculation to take into account Windows encoding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated crx_id windows unit test to escape backslash Created 7 years, 6 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 | « tools/crx_id/crx_id.py ('k') | tools/telemetry/telemetry/core/extension_to_load.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/crx_id/crx_id_unittest.py
diff --git a/tools/crx_id/crx_id_unittest.py b/tools/crx_id/crx_id_unittest.py
index 3d54ebfd24ccd4dd98b85da745287c406144c75b..4d0f80f753420c92d30e3a3c92a93f70c2652ae3 100755
--- a/tools/crx_id/crx_id_unittest.py
+++ b/tools/crx_id/crx_id_unittest.py
@@ -63,13 +63,22 @@ class CrxIdUnittest(unittest.TestCase):
self.assertEqual(crx_id.GetCRXAppID('/tmp/temp_extension',
from_file_path=True),
'ajbbicncdkdlchpjplgjaglppbcbmaji')
+
+ def testFromWindowsPath(self):
+ self.assertEqual(crx_id.GetCRXAppID(r'D:\Documents\chrome\test_extension',
+ from_file_path=True,
+ is_win_path=True),
+ 'fegemedmbnhglnecjgbdhekaghkccplm')
+
# Test drive letter normalization.
- kWinPathId = 'popnagglbbhjlobnnbcjnckakjoegnjp'
- self.assertEqual(crx_id.GetCRXAppID('c:\temp_extension',
- from_file_path=True),
+ kWinPathId = 'aiinlcdagjihibappcdnnhcccdokjlaf'
+ self.assertEqual(crx_id.GetCRXAppID(r'c:\temp_extension',
+ from_file_path=True,
+ is_win_path=True),
kWinPathId)
- self.assertEqual(crx_id.GetCRXAppID('C:\temp_extension',
- from_file_path=True),
+ self.assertEqual(crx_id.GetCRXAppID(r'C:\temp_extension',
+ from_file_path=True,
+ is_win_path=True),
kWinPathId)
if __name__ == '__main__':
« no previous file with comments | « tools/crx_id/crx_id.py ('k') | tools/telemetry/telemetry/core/extension_to_load.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698