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

Unified Diff: ui/file_manager/file_manager/common/js/importer_common_unittest.js

Issue 954583004: Shrink space required by history log file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: ui/file_manager/file_manager/common/js/importer_common_unittest.js
diff --git a/ui/file_manager/file_manager/common/js/importer_common_unittest.js b/ui/file_manager/file_manager/common/js/importer_common_unittest.js
index 9018108d3f9554563bf1c2aa7f0bfd3f32d11084..ea0e7d6bf3c2bc3e91fc9766f7a844119e856b6b 100644
--- a/ui/file_manager/file_manager/common/js/importer_common_unittest.js
+++ b/ui/file_manager/file_manager/common/js/importer_common_unittest.js
@@ -223,6 +223,21 @@ function testRotateLogs_RemembersInitialActiveLog(callback) {
reportPromise(promise, callback);
}
+function testDeflateAppUrl() {
+ var url = 'filesystem:chrome-extension://hhaomjibdihmijegdhdafkllkbggdgoj' +
+ '/external/removable/USB%20Drive/DCIM/derekkind2.jpg';
+ var deflated = importer.deflateAppUrl(url);
+
+ // Just verify that the string starts with our secret sauce marker...
+ assertTrue(deflated.substring(0, 1) === '$');
mtomasz 2015/02/25 00:40:17 nit: assertEquals can be used for better logging.
Steve McKay 2015/02/25 01:51:56 Done.
+
+ // And that it is shorter than the original...
+ assertTrue(deflated.length < url.length);
+
+ // And finally that we can reconstitute the original.
+ assertEquals(importer.inflateAppUrl(deflated), url);
mtomasz 2015/02/25 00:40:17 nit: Opposite order of arguments. Should be assert
Steve McKay 2015/02/25 01:51:56 Done.
+};
+
/** @param {string} path */
function assertIsMediaDir(path) {
var dir = createDirectoryEntry(sdVolume, path);

Powered by Google App Engine
This is Rietveld 408576698