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

Side by Side Diff: chrome/browser/media_galleries/fileapi/itunes_data_provider_browsertest.cc

Issue 23449015: iTunes artist, album, and track names need to be escaped for slash and colon. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 "Artist", "Album2", 386 "Artist", "Album2",
387 "Track.mp3").NormalizePathSeparators().value()); 387 "Track.mp3").NormalizePathSeparators().value());
388 388
389 TestDone(); 389 TestDone();
390 } 390 }
391 391
392 private: 392 private:
393 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderUniqueNameTest); 393 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderUniqueNameTest);
394 }; 394 };
395 395
396 class ITunesDataProviderEscapeTest : public ITunesDataProviderTest {
397 public:
398 ITunesDataProviderEscapeTest() {}
399 virtual ~ITunesDataProviderEscapeTest() {}
400
401 virtual std::vector<LibraryEntry> SetUpLibrary() OVERRIDE {
402 base::FilePath track = library_dir().AppendASCII("Track:1.mp3");
403 std::vector<LibraryEntry> entries;
404 entries.push_back(LibraryEntry("Artist:/name", "Album:name/", track));
Lei Zhang 2013/08/29 23:28:38 Can we add either some more entries or another tes
vandebo (ex-Chrome) 2013/08/30 03:48:32 Done.
405 return entries;
406 }
407
408 virtual void StartTest(bool parse_success) OVERRIDE {
409 EXPECT_TRUE(parse_success);
410
411 base::FilePath track =
412 library_dir().AppendASCII("Track:1.mp3").NormalizePathSeparators();
413 EXPECT_EQ(track.value(),
414 data_provider()->GetTrackLocation(
415 "Artist__name", "Album_name_",
416 "Track_1.mp3").NormalizePathSeparators().value());
417 TestDone();
418 }
419
420 private:
421 DISALLOW_COPY_AND_ASSIGN(ITunesDataProviderEscapeTest);
422 };
423
396 IN_PROC_BROWSER_TEST_F(ITunesDataProviderBasicTest, BasicTest) { 424 IN_PROC_BROWSER_TEST_F(ITunesDataProviderBasicTest, BasicTest) {
397 RunTest(); 425 RunTest();
398 } 426 }
399 427
400 IN_PROC_BROWSER_TEST_F(ITunesDataProviderRefreshTest, RefreshTest) { 428 IN_PROC_BROWSER_TEST_F(ITunesDataProviderRefreshTest, RefreshTest) {
401 RunTest(); 429 RunTest();
402 } 430 }
403 431
404 IN_PROC_BROWSER_TEST_F(ITunesDataProviderInvalidTest, InvalidTest) { 432 IN_PROC_BROWSER_TEST_F(ITunesDataProviderInvalidTest, InvalidTest) {
405 RunTest(); 433 RunTest();
406 } 434 }
407 435
408 IN_PROC_BROWSER_TEST_F(ITunesDataProviderUniqueNameTest, UniqueNameTest) { 436 IN_PROC_BROWSER_TEST_F(ITunesDataProviderUniqueNameTest, UniqueNameTest) {
409 RunTest(); 437 RunTest();
410 } 438 }
411 439
440 IN_PROC_BROWSER_TEST_F(ITunesDataProviderEscapeTest, EscapeTest) {
441 RunTest();
442 }
443
412 } // namespace itunes 444 } // namespace itunes
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698