OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "chrome/browser/media_galleries/media_galleries_test_util.h" | 5 #include "chrome/browser/media_galleries/media_galleries_test_util.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 EXPECT_TRUE(extension.get() != NULL) << errors; | 53 EXPECT_TRUE(extension.get() != NULL) << errors; |
54 EXPECT_TRUE(extensions::Extension::IdIsValid(extension->id())); | 54 EXPECT_TRUE(extensions::Extension::IdIsValid(extension->id())); |
55 if (!extension.get() || !extensions::Extension::IdIsValid(extension->id())) | 55 if (!extension.get() || !extensions::Extension::IdIsValid(extension->id())) |
56 return NULL; | 56 return NULL; |
57 | 57 |
58 extension_prefs->OnExtensionInstalled( | 58 extension_prefs->OnExtensionInstalled( |
59 extension.get(), extensions::Extension::ENABLED, | 59 extension.get(), extensions::Extension::ENABLED, |
60 syncer::StringOrdinal::CreateInitialOrdinal()); | 60 syncer::StringOrdinal::CreateInitialOrdinal()); |
61 ExtensionService* extension_service = | 61 ExtensionService* extension_service = |
62 extensions::ExtensionSystem::Get(profile)->extension_service(); | 62 extensions::ExtensionSystem::Get(profile)->extension_service(); |
63 extension_service->AddExtension(extension); | 63 extension_service->AddExtension(extension.get()); |
64 extension_service->EnableExtension(extension->id()); | 64 extension_service->EnableExtension(extension->id()); |
65 | 65 |
66 return extension; | 66 return extension; |
67 } | 67 } |
68 | 68 |
69 EnsureMediaDirectoriesExists::EnsureMediaDirectoriesExists() | 69 EnsureMediaDirectoriesExists::EnsureMediaDirectoriesExists() |
70 : num_galleries_(0) { | 70 : num_galleries_(0) { |
71 Init(); | 71 Init(); |
72 } | 72 } |
73 | 73 |
(...skipping 23 matching lines...) Expand all Loading... |
97 if (PathService::Get(kDirectoryKeys[i], &path) && | 97 if (PathService::Get(kDirectoryKeys[i], &path) && |
98 file_util::DirectoryExists(path)) { | 98 file_util::DirectoryExists(path)) { |
99 ++num_galleries_; | 99 ++num_galleries_; |
100 } | 100 } |
101 } | 101 } |
102 ASSERT_GT(num_galleries_, 0); | 102 ASSERT_GT(num_galleries_, 0); |
103 #endif | 103 #endif |
104 } | 104 } |
105 | 105 |
106 } // namespace chrome | 106 } // namespace chrome |
OLD | NEW |