| OLD | NEW |
| 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 "base/files/file_path.h" | 5 #include "base/files/file_path.h" |
| 6 #include "base/string_util.h" | |
| 7 #include "base/strings/string16.h" | 6 #include "base/strings/string16.h" |
| 7 #include "base/strings/string_util.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" | 9 #include "chrome/browser/media_galleries/media_galleries_dialog_controller.h" |
| 10 #include "chrome/browser/media_galleries/media_galleries_preferences.h" | 10 #include "chrome/browser/media_galleries/media_galleries_preferences.h" |
| 11 #include "chrome/browser/storage_monitor/storage_info.h" | 11 #include "chrome/browser/storage_monitor/storage_info.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 std::string GalleryName(const chrome::MediaGalleryPrefInfo& gallery) { | 14 std::string GalleryName(const chrome::MediaGalleryPrefInfo& gallery) { |
| 15 string16 name = gallery.GetGalleryDisplayName(); | 15 string16 name = gallery.GetGalleryDisplayName(); |
| 16 return UTF16ToASCII(name); | 16 return UTF16ToASCII(name); |
| 17 } | 17 } |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 gallery.volume_label = string16(); | 52 gallery.volume_label = string16(); |
| 53 EXPECT_EQ("vendor, model", GalleryName(gallery)); | 53 EXPECT_EQ("vendor, model", GalleryName(gallery)); |
| 54 | 54 |
| 55 gallery.total_size_in_bytes = 1000000; | 55 gallery.total_size_in_bytes = 1000000; |
| 56 EXPECT_EQ("977 KB vendor, model", GalleryName(gallery)); | 56 EXPECT_EQ("977 KB vendor, model", GalleryName(gallery)); |
| 57 | 57 |
| 58 gallery.path = base::FilePath(FILE_PATH_LITERAL("sub/path")); | 58 gallery.path = base::FilePath(FILE_PATH_LITERAL("sub/path")); |
| 59 EXPECT_EQ("path - 977 KB vendor, model", GalleryName(gallery)); | 59 EXPECT_EQ("path - 977 KB vendor, model", GalleryName(gallery)); |
| 60 } | 60 } |
| OLD | NEW |