OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // Browser test for basic Chrome OS file manager functionality: | 5 // Browser test for basic Chrome OS file manager functionality: |
6 // - The file list is updated when a file is added externally to the Downloads | 6 // - The file list is updated when a file is added externally to the Downloads |
7 // folder. | 7 // folder. |
8 // - Selecting a file and copy-pasting it with the keyboard copies the file. | 8 // - Selecting a file and copy-pasting it with the keyboard copies the file. |
9 // - Selecting a file and pressing delete deletes it. | 9 // - Selecting a file and pressing delete deletes it. |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/extensions/component_loader.h" | 22 #include "chrome/browser/extensions/component_loader.h" |
23 #include "chrome/browser/extensions/extension_apitest.h" | 23 #include "chrome/browser/extensions/extension_apitest.h" |
24 #include "chrome/browser/extensions/extension_service.h" | 24 #include "chrome/browser/extensions/extension_service.h" |
25 #include "chrome/browser/extensions/extension_test_message_listener.h" | 25 #include "chrome/browser/extensions/extension_test_message_listener.h" |
26 #include "chrome/browser/profiles/profile.h" | 26 #include "chrome/browser/profiles/profile.h" |
27 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
29 #include "chrome/common/chrome_switches.h" | 29 #include "chrome/common/chrome_switches.h" |
30 #include "chrome/common/extensions/extension.h" | 30 #include "chrome/common/extensions/extension.h" |
31 #include "chrome/test/base/ui_test_utils.h" | 31 #include "chrome/test/base/ui_test_utils.h" |
32 #include "chromeos/chromeos_switches.h" | |
33 #include "content/public/browser/browser_context.h" | 32 #include "content/public/browser/browser_context.h" |
34 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
35 #include "net/base/escape.h" | 34 #include "net/base/escape.h" |
36 #include "webkit/fileapi/external_mount_points.h" | 35 #include "webkit/fileapi/external_mount_points.h" |
37 | 36 |
38 namespace { | 37 namespace { |
39 | 38 |
40 const char kFileManagerExtensionId[] = "hhaomjibdihmijegdhdafkllkbggdgoj"; | 39 const char kFileManagerExtensionId[] = "hhaomjibdihmijegdhdafkllkbggdgoj"; |
41 | 40 |
42 const char kKeyboardTestFileName[] = "world.mpeg"; | 41 const char kKeyboardTestFileName[] = "world.mpeg"; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // Files starting with . are filtered out in | 102 // Files starting with . are filtered out in |
104 // file_manager/js/directory_contents.js, so this should not be shown. | 103 // file_manager/js/directory_contents.js, so this should not be shown. |
105 CreateTestDirectory(".warez", "26 Oct 1985 13:39"); | 104 CreateTestDirectory(".warez", "26 Oct 1985 13:39"); |
106 | 105 |
107 ExtensionApiTest::SetUp(); | 106 ExtensionApiTest::SetUp(); |
108 } | 107 } |
109 | 108 |
110 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 109 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { |
111 bool in_guest_mode = GetParam(); | 110 bool in_guest_mode = GetParam(); |
112 if (in_guest_mode) { | 111 if (in_guest_mode) { |
113 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 112 command_line->AppendSwitch(switches::kGuestSession); |
114 command_line->AppendSwitch(switches::kIncognito); | 113 command_line->AppendSwitch(switches::kIncognito); |
115 } | 114 } |
116 ExtensionApiTest::SetUpCommandLine(command_line); | 115 ExtensionApiTest::SetUpCommandLine(command_line); |
117 } | 116 } |
118 | 117 |
119 protected: | 118 protected: |
120 // Creates a file with the given |name|, |length|, and |modification_time|. | 119 // Creates a file with the given |name|, |length|, and |modification_time|. |
121 void CreateTestFile(const std::string& name, | 120 void CreateTestFile(const std::string& name, |
122 int length, | 121 int length, |
123 const std::string& modification_time); | 122 const std::string& modification_time); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 watcher.StartAndWaitUntilReady(); | 346 watcher.StartAndWaitUntilReady(); |
348 | 347 |
349 ResultCatcher catcher; | 348 ResultCatcher catcher; |
350 StartTest("keyboard delete"); | 349 StartTest("keyboard delete"); |
351 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 350 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
352 | 351 |
353 ASSERT_TRUE(watcher.RunMessageLoopUntilConditionSatisfied()); | 352 ASSERT_TRUE(watcher.RunMessageLoopUntilConditionSatisfied()); |
354 } | 353 } |
355 | 354 |
356 } // namespace | 355 } // namespace |
OLD | NEW |