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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 #include "base/strings/stringprintf.h" | 6 #include "base/strings/stringprintf.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/extensions/extension_apitest.h" | 8 #include "chrome/browser/extensions/extension_apitest.h" |
9 #include "chrome/browser/extensions/extension_process_manager.h" | 9 #include "chrome/browser/extensions/extension_process_manager.h" |
10 #include "chrome/browser/extensions/extension_system.h" | 10 #include "chrome/browser/extensions/extension_system.h" |
11 #include "chrome/browser/extensions/platform_app_browsertest_util.h" | 11 #include "chrome/browser/extensions/platform_app_browsertest_util.h" |
12 #include "chrome/browser/media_galleries/media_galleries_test_util.h" | 12 #include "chrome/browser/media_galleries/media_galleries_test_util.h" |
13 #include "chrome/browser/storage_monitor/storage_info.h" | 13 #include "chrome/browser/storage_monitor/storage_info.h" |
14 #include "chrome/browser/storage_monitor/storage_monitor.h" | 14 #include "chrome/browser/storage_monitor/storage_monitor.h" |
15 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
16 #include "chrome/common/chrome_switches.h" | |
17 #include "content/public/browser/render_view_host.h" | 16 #include "content/public/browser/render_view_host.h" |
18 #include "content/public/test/test_utils.h" | 17 #include "content/public/test/test_utils.h" |
| 18 #include "extensions/common/switches.h" |
19 | 19 |
20 using extensions::PlatformAppBrowserTest; | 20 using extensions::PlatformAppBrowserTest; |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Dummy device properties. | 24 // Dummy device properties. |
25 const char kDeviceId[] = "testDeviceId"; | 25 const char kDeviceId[] = "testDeviceId"; |
26 const char kDeviceName[] = "foobar"; | 26 const char kDeviceName[] = "foobar"; |
27 #if defined(FILE_PATH_USES_DRIVE_LETTERS) | 27 #if defined(FILE_PATH_USES_DRIVE_LETTERS) |
28 base::FilePath::CharType kDevicePath[] = FILE_PATH_LITERAL("C:\\qux"); | 28 base::FilePath::CharType kDevicePath[] = FILE_PATH_LITERAL("C:\\qux"); |
29 #else | 29 #else |
30 base::FilePath::CharType kDevicePath[] = FILE_PATH_LITERAL("/qux"); | 30 base::FilePath::CharType kDevicePath[] = FILE_PATH_LITERAL("/qux"); |
31 #endif | 31 #endif |
32 | 32 |
33 const char kTestGalleries[] = "testGalleries(%d)"; | 33 const char kTestGalleries[] = "testGalleries(%d)"; |
34 | 34 |
35 class MediaGalleriesExperimentalApiTest : public ExtensionApiTest { | 35 class MediaGalleriesExperimentalApiTest : public ExtensionApiTest { |
36 public: | 36 public: |
37 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 37 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
38 ExtensionApiTest::SetUpCommandLine(command_line); | 38 ExtensionApiTest::SetUpCommandLine(command_line); |
39 command_line->AppendSwitch(switches::kEnableExperimentalExtensionApis); | 39 command_line->AppendSwitch( |
| 40 extensions::switches::kEnableExperimentalExtensionApis); |
40 } | 41 } |
41 }; | 42 }; |
42 | 43 |
43 } // namespace | 44 } // namespace |
44 | 45 |
45 class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { | 46 class MediaGalleriesPlatformAppBrowserTest : public PlatformAppBrowserTest { |
46 protected: | 47 protected: |
47 // Since ExtensionTestMessageListener does not work with RunPlatformAppTest(), | 48 // Since ExtensionTestMessageListener does not work with RunPlatformAppTest(), |
48 // This helper method can be used to run additional media gallery tests. | 49 // This helper method can be used to run additional media gallery tests. |
49 void RunSecondTestPhase(const string16& command) { | 50 void RunSecondTestPhase(const string16& command) { |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 chrome::EnsureMediaDirectoriesExists media_directories; | 132 chrome::EnsureMediaDirectoriesExists media_directories; |
132 ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/metadata")) | 133 ASSERT_TRUE(RunPlatformAppTest("api_test/media_galleries/metadata")) |
133 << message_; | 134 << message_; |
134 } | 135 } |
135 | 136 |
136 | 137 |
137 IN_PROC_BROWSER_TEST_F(MediaGalleriesExperimentalApiTest, | 138 IN_PROC_BROWSER_TEST_F(MediaGalleriesExperimentalApiTest, |
138 ExperimentalMediaGalleries) { | 139 ExperimentalMediaGalleries) { |
139 ASSERT_TRUE(RunExtensionTest("media_galleries/experimental")) << message_; | 140 ASSERT_TRUE(RunExtensionTest("media_galleries/experimental")) << message_; |
140 } | 141 } |
OLD | NEW |