Bug 792983 - Device Storage - device storage file types compares must be case insensitive. r=khuey
authorDoug Turner <dougt@dougt.org>
Thu, 20 Sep 2012 14:08:50 -0700
changeset 107590 1406e15f239b155bbc1c5af133875006efa399fe
parent 107589 7b8dca41f2d6df946bf12793db26aacefbf1f9a3
child 107591 2e6335deeb512ced664701d20622ef898e6fb82d
push id23494
push userdougt@mozilla.com
push dateThu, 20 Sep 2012 21:08:59 +0000
treeherdermozilla-central@1406e15f239b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs792983
milestone18.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 792983 - Device Storage - device storage file types compares must be case insensitive. r=khuey
dom/devicestorage/nsDeviceStorage.cpp
dom/devicestorage/test/test_enumerate.html
--- a/dom/devicestorage/nsDeviceStorage.cpp
+++ b/dom/devicestorage/nsDeviceStorage.cpp
@@ -161,25 +161,25 @@ DeviceStorageTypeChecker::Check(const ns
   }
 
   nsAutoString extensionMatch;
   extensionMatch.AssignLiteral("*");
   extensionMatch.Append(Substring(path, dotIdx));
   extensionMatch.AppendLiteral(";");
 
   if (aType.EqualsLiteral(DEVICESTORAGE_PICTURES)) {
-    return FindInReadable(extensionMatch, mPicturesExtensions);
+    return CaseInsensitiveFindInReadable(extensionMatch, mPicturesExtensions);
   }
 
   if (aType.EqualsLiteral(DEVICESTORAGE_VIDEOS)) {
-    return FindInReadable(extensionMatch, mVideosExtensions);
+    return CaseInsensitiveFindInReadable(extensionMatch, mVideosExtensions);
   }
 
   if (aType.EqualsLiteral(DEVICESTORAGE_MUSIC)) {
-    return FindInReadable(extensionMatch, mMusicExtensions);
+    return CaseInsensitiveFindInReadable(extensionMatch, mMusicExtensions);
   }
 
   return false;
 }
 
 nsresult
 DeviceStorageTypeChecker::GetPermissionForType(const nsAString& aType, nsACString& aPermissionResult)
 {
--- a/dom/devicestorage/test/test_enumerate.html
+++ b/dom/devicestorage/test/test_enumerate.html
@@ -66,17 +66,17 @@ function addError(e) {
   ok(false, "addError was called : " + e.target.error.name);
   devicestorage_cleanup();
 }
 
 var storage = navigator.getDeviceStorage("pictures");
 ok(navigator.getDeviceStorage, "Should have getDeviceStorage");
 var prefix = "devicestorage/" + randomFilename(12) + ".png"
 
-var files = [ "a.png", "b.png", "c.png", "d/a.png", "d/b.png", "d/c.png", "d/d.png", "The/quick/brown/fox/jumps/over/the/lazy/dog.png"]
+var files = [ "a.PNG", "b.pnG", "c.png", "d/a.png", "d/b.png", "d/c.png", "d/d.png", "The/quick/brown/fox/jumps/over/the/lazy/dog.png"]
 var addedSoFar = 0;
 
 
 for (var i=0; i<files.length; i++) {
 
  request = storage.addNamed(createRandomBlob('image/png'), prefix + '/' + files[i]);
 
  ok(request, "Should have a non-null request");