| 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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 270 } | 270 } |
| 271 | 271 |
| 272 std::map<base::FilePath, const TestEntryInfo> entries_; | 272 std::map<base::FilePath, const TestEntryInfo> entries_; |
| 273 }; | 273 }; |
| 274 | 274 |
| 275 class DownloadsTestVolume : public LocalTestVolume { | 275 class DownloadsTestVolume : public LocalTestVolume { |
| 276 public: | 276 public: |
| 277 DownloadsTestVolume() : LocalTestVolume("Downloads") {} | 277 DownloadsTestVolume() : LocalTestVolume("Downloads") {} |
| 278 virtual ~DownloadsTestVolume() {} | 278 virtual ~DownloadsTestVolume() {} |
| 279 | 279 |
| 280 virtual bool Mount(Profile* profile) OVERRIDE { | 280 virtual bool Mount(Profile* profile) override { |
| 281 return CreateRootDirectory(profile) && | 281 return CreateRootDirectory(profile) && |
| 282 VolumeManager::Get(profile) | 282 VolumeManager::Get(profile) |
| 283 ->RegisterDownloadsDirectoryForTesting(root_path()); | 283 ->RegisterDownloadsDirectoryForTesting(root_path()); |
| 284 } | 284 } |
| 285 }; | 285 }; |
| 286 | 286 |
| 287 // Test volume for mimicing a specified type of volumes by a local folder. | 287 // Test volume for mimicing a specified type of volumes by a local folder. |
| 288 class FakeTestVolume : public LocalTestVolume { | 288 class FakeTestVolume : public LocalTestVolume { |
| 289 public: | 289 public: |
| 290 FakeTestVolume(const std::string& name, | 290 FakeTestVolume(const std::string& name, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 302 // Must be in sync with BASIC_FAKE_ENTRY_SET in the JS test code. | 302 // Must be in sync with BASIC_FAKE_ENTRY_SET in the JS test code. |
| 303 CreateEntry( | 303 CreateEntry( |
| 304 TestEntryInfo(FILE, "text.txt", "hello.txt", "text/plain", NONE, | 304 TestEntryInfo(FILE, "text.txt", "hello.txt", "text/plain", NONE, |
| 305 base::Time::Now())); | 305 base::Time::Now())); |
| 306 CreateEntry( | 306 CreateEntry( |
| 307 TestEntryInfo(DIRECTORY, std::string(), "A", std::string(), NONE, | 307 TestEntryInfo(DIRECTORY, std::string(), "A", std::string(), NONE, |
| 308 base::Time::Now())); | 308 base::Time::Now())); |
| 309 return true; | 309 return true; |
| 310 } | 310 } |
| 311 | 311 |
| 312 virtual bool Mount(Profile* profile) OVERRIDE { | 312 virtual bool Mount(Profile* profile) override { |
| 313 if (!CreateRootDirectory(profile)) | 313 if (!CreateRootDirectory(profile)) |
| 314 return false; | 314 return false; |
| 315 storage::ExternalMountPoints* const mount_points = | 315 storage::ExternalMountPoints* const mount_points = |
| 316 storage::ExternalMountPoints::GetSystemInstance(); | 316 storage::ExternalMountPoints::GetSystemInstance(); |
| 317 | 317 |
| 318 // First revoke the existing mount point (if any). | 318 // First revoke the existing mount point (if any). |
| 319 mount_points->RevokeFileSystem(name()); | 319 mount_points->RevokeFileSystem(name()); |
| 320 const bool result = | 320 const bool result = |
| 321 mount_points->RegisterFileSystem(name(), | 321 mount_points->RegisterFileSystem(name(), |
| 322 storage::kFileSystemTypeNativeLocal, | 322 storage::kFileSystemTypeNativeLocal, |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 Message GetNextMessage() { | 498 Message GetNextMessage() { |
| 499 if (messages_.empty()) | 499 if (messages_.empty()) |
| 500 content::RunMessageLoop(); | 500 content::RunMessageLoop(); |
| 501 const Message entry = messages_.front(); | 501 const Message entry = messages_.front(); |
| 502 messages_.pop_front(); | 502 messages_.pop_front(); |
| 503 return entry; | 503 return entry; |
| 504 } | 504 } |
| 505 | 505 |
| 506 virtual void Observe(int type, | 506 virtual void Observe(int type, |
| 507 const content::NotificationSource& source, | 507 const content::NotificationSource& source, |
| 508 const content::NotificationDetails& details) OVERRIDE { | 508 const content::NotificationDetails& details) override { |
| 509 Message entry; | 509 Message entry; |
| 510 entry.type = type; | 510 entry.type = type; |
| 511 entry.message = type != extensions::NOTIFICATION_EXTENSION_TEST_PASSED | 511 entry.message = type != extensions::NOTIFICATION_EXTENSION_TEST_PASSED |
| 512 ? *content::Details<std::string>(details).ptr() | 512 ? *content::Details<std::string>(details).ptr() |
| 513 : std::string(); | 513 : std::string(); |
| 514 entry.function = | 514 entry.function = |
| 515 type == extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE | 515 type == extensions::NOTIFICATION_EXTENSION_TEST_MESSAGE |
| 516 ? content::Source<extensions::TestSendMessageFunction>(source).ptr() | 516 ? content::Source<extensions::TestSendMessageFunction>(source).ptr() |
| 517 : NULL; | 517 : NULL; |
| 518 messages_.push_back(entry); | 518 messages_.push_back(entry); |
| 519 base::MessageLoopForUI::current()->Quit(); | 519 base::MessageLoopForUI::current()->Quit(); |
| 520 } | 520 } |
| 521 | 521 |
| 522 private: | 522 private: |
| 523 std::deque<Message> messages_; | 523 std::deque<Message> messages_; |
| 524 content::NotificationRegistrar registrar_; | 524 content::NotificationRegistrar registrar_; |
| 525 }; | 525 }; |
| 526 | 526 |
| 527 // The base test class. | 527 // The base test class. |
| 528 class FileManagerBrowserTestBase : public ExtensionApiTest { | 528 class FileManagerBrowserTestBase : public ExtensionApiTest { |
| 529 protected: | 529 protected: |
| 530 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | 530 virtual void SetUpInProcessBrowserTestFixture() override; |
| 531 | 531 |
| 532 virtual void SetUpOnMainThread() OVERRIDE; | 532 virtual void SetUpOnMainThread() override; |
| 533 | 533 |
| 534 // Adds an incognito and guest-mode flags for tests in the guest mode. | 534 // Adds an incognito and guest-mode flags for tests in the guest mode. |
| 535 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 535 virtual void SetUpCommandLine(CommandLine* command_line) override; |
| 536 | 536 |
| 537 // Loads our testing extension and sends it a string identifying the current | 537 // Loads our testing extension and sends it a string identifying the current |
| 538 // test. | 538 // test. |
| 539 virtual void StartTest(); | 539 virtual void StartTest(); |
| 540 void RunTestMessageLoop(); | 540 void RunTestMessageLoop(); |
| 541 | 541 |
| 542 // Overriding point for test configurations. | 542 // Overriding point for test configurations. |
| 543 virtual const char* GetTestManifestName() const { | 543 virtual const char* GetTestManifestName() const { |
| 544 return "file_manager_test_manifest.json"; | 544 return "file_manager_test_manifest.json"; |
| 545 } | 545 } |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 732 } |
| 733 | 733 |
| 734 // Parameter of FileManagerBrowserTest. | 734 // Parameter of FileManagerBrowserTest. |
| 735 // The second value is the case name of JavaScript. | 735 // The second value is the case name of JavaScript. |
| 736 typedef std::tr1::tuple<GuestMode, const char*> TestParameter; | 736 typedef std::tr1::tuple<GuestMode, const char*> TestParameter; |
| 737 | 737 |
| 738 // Test fixture class for normal (not multi-profile related) tests. | 738 // Test fixture class for normal (not multi-profile related) tests. |
| 739 class FileManagerBrowserTest : | 739 class FileManagerBrowserTest : |
| 740 public FileManagerBrowserTestBase, | 740 public FileManagerBrowserTestBase, |
| 741 public ::testing::WithParamInterface<TestParameter> { | 741 public ::testing::WithParamInterface<TestParameter> { |
| 742 virtual GuestMode GetGuestModeParam() const OVERRIDE { | 742 virtual GuestMode GetGuestModeParam() const override { |
| 743 return std::tr1::get<0>(GetParam()); | 743 return std::tr1::get<0>(GetParam()); |
| 744 } | 744 } |
| 745 virtual const char* GetTestCaseNameParam() const OVERRIDE { | 745 virtual const char* GetTestCaseNameParam() const override { |
| 746 return std::tr1::get<1>(GetParam()); | 746 return std::tr1::get<1>(GetParam()); |
| 747 } | 747 } |
| 748 }; | 748 }; |
| 749 | 749 |
| 750 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTest, Test) { | 750 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTest, Test) { |
| 751 StartTest(); | 751 StartTest(); |
| 752 } | 752 } |
| 753 | 753 |
| 754 // Unlike TEST/TEST_F, which are macros that expand to further macros, | 754 // Unlike TEST/TEST_F, which are macros that expand to further macros, |
| 755 // INSTANTIATE_TEST_CASE_P is a macro that expands directly to code that | 755 // INSTANTIATE_TEST_CASE_P is a macro that expands directly to code that |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1080 {"__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, | 1080 {"__dummy__@invalid.domain", "hashdummy", "Dummy Account"}, |
| 1081 {"alice@invalid.domain", "hashalice", "Alice"}, | 1081 {"alice@invalid.domain", "hashalice", "Alice"}, |
| 1082 {"bob@invalid.domain", "hashbob", "Bob"}, | 1082 {"bob@invalid.domain", "hashbob", "Bob"}, |
| 1083 {"charlie@invalid.domain", "hashcharlie", "Charlie"}, | 1083 {"charlie@invalid.domain", "hashcharlie", "Charlie"}, |
| 1084 }; | 1084 }; |
| 1085 | 1085 |
| 1086 // Test fixture class for testing multi-profile features. | 1086 // Test fixture class for testing multi-profile features. |
| 1087 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { | 1087 class MultiProfileFileManagerBrowserTest : public FileManagerBrowserTestBase { |
| 1088 protected: | 1088 protected: |
| 1089 // Enables multi-profiles. | 1089 // Enables multi-profiles. |
| 1090 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 1090 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 1091 FileManagerBrowserTestBase::SetUpCommandLine(command_line); | 1091 FileManagerBrowserTestBase::SetUpCommandLine(command_line); |
| 1092 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; | 1092 // Logs in to a dummy profile (For making MultiProfileWindowManager happy; |
| 1093 // browser test creates a default window and the manager tries to assign a | 1093 // browser test creates a default window and the manager tries to assign a |
| 1094 // user for it, and we need a profile connected to a user.) | 1094 // user for it, and we need a profile connected to a user.) |
| 1095 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, | 1095 command_line->AppendSwitchASCII(chromeos::switches::kLoginUser, |
| 1096 kTestAccounts[DUMMY_ACCOUNT_INDEX].email); | 1096 kTestAccounts[DUMMY_ACCOUNT_INDEX].email); |
| 1097 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, | 1097 command_line->AppendSwitchASCII(chromeos::switches::kLoginProfile, |
| 1098 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash); | 1098 kTestAccounts[DUMMY_ACCOUNT_INDEX].hash); |
| 1099 } | 1099 } |
| 1100 | 1100 |
| 1101 // Logs in to the primary profile of this test. | 1101 // Logs in to the primary profile of this test. |
| 1102 virtual void SetUpOnMainThread() OVERRIDE { | 1102 virtual void SetUpOnMainThread() override { |
| 1103 const TestAccountInfo& info = kTestAccounts[PRIMARY_ACCOUNT_INDEX]; | 1103 const TestAccountInfo& info = kTestAccounts[PRIMARY_ACCOUNT_INDEX]; |
| 1104 | 1104 |
| 1105 AddUser(info, true); | 1105 AddUser(info, true); |
| 1106 FileManagerBrowserTestBase::SetUpOnMainThread(); | 1106 FileManagerBrowserTestBase::SetUpOnMainThread(); |
| 1107 } | 1107 } |
| 1108 | 1108 |
| 1109 // Loads all users to the current session and sets up necessary fields. | 1109 // Loads all users to the current session and sets up necessary fields. |
| 1110 // This is used for preparing all accounts in PRE_ test setup, and for testing | 1110 // This is used for preparing all accounts in PRE_ test setup, and for testing |
| 1111 // actual login behavior. | 1111 // actual login behavior. |
| 1112 void AddAllUsers() { | 1112 void AddAllUsers() { |
| 1113 for (size_t i = 0; i < arraysize(kTestAccounts); ++i) | 1113 for (size_t i = 0; i < arraysize(kTestAccounts); ++i) |
| 1114 AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START); | 1114 AddUser(kTestAccounts[i], i >= SECONDARY_ACCOUNT_INDEX_START); |
| 1115 } | 1115 } |
| 1116 | 1116 |
| 1117 // Returns primary profile (if it is already created.) | 1117 // Returns primary profile (if it is already created.) |
| 1118 virtual Profile* profile() OVERRIDE { | 1118 virtual Profile* profile() override { |
| 1119 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( | 1119 Profile* const profile = chromeos::ProfileHelper::GetProfileByUserIdHash( |
| 1120 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); | 1120 kTestAccounts[PRIMARY_ACCOUNT_INDEX].hash); |
| 1121 return profile ? profile : FileManagerBrowserTestBase::profile(); | 1121 return profile ? profile : FileManagerBrowserTestBase::profile(); |
| 1122 } | 1122 } |
| 1123 | 1123 |
| 1124 // Sets the test case name (used as a function name in test_cases.js to call.) | 1124 // Sets the test case name (used as a function name in test_cases.js to call.) |
| 1125 void set_test_case_name(const std::string& name) { test_case_name_ = name; } | 1125 void set_test_case_name(const std::string& name) { test_case_name_ = name; } |
| 1126 | 1126 |
| 1127 // Adds a new user for testing to the current session. | 1127 // Adds a new user for testing to the current session. |
| 1128 void AddUser(const TestAccountInfo& info, bool log_in) { | 1128 void AddUser(const TestAccountInfo& info, bool log_in) { |
| 1129 user_manager::UserManager* const user_manager = | 1129 user_manager::UserManager* const user_manager = |
| 1130 user_manager::UserManager::Get(); | 1130 user_manager::UserManager::Get(); |
| 1131 if (log_in) | 1131 if (log_in) |
| 1132 user_manager->UserLoggedIn(info.email, info.hash, false); | 1132 user_manager->UserLoggedIn(info.email, info.hash, false); |
| 1133 user_manager->SaveUserDisplayName(info.email, | 1133 user_manager->SaveUserDisplayName(info.email, |
| 1134 base::UTF8ToUTF16(info.display_name)); | 1134 base::UTF8ToUTF16(info.display_name)); |
| 1135 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> | 1135 chromeos::ProfileHelper::GetProfileByUserIdHash(info.hash)->GetPrefs()-> |
| 1136 SetString(prefs::kGoogleServicesUsername, info.email); | 1136 SetString(prefs::kGoogleServicesUsername, info.email); |
| 1137 } | 1137 } |
| 1138 | 1138 |
| 1139 private: | 1139 private: |
| 1140 virtual GuestMode GetGuestModeParam() const OVERRIDE { | 1140 virtual GuestMode GetGuestModeParam() const override { |
| 1141 return NOT_IN_GUEST_MODE; | 1141 return NOT_IN_GUEST_MODE; |
| 1142 } | 1142 } |
| 1143 | 1143 |
| 1144 virtual const char* GetTestCaseNameParam() const OVERRIDE { | 1144 virtual const char* GetTestCaseNameParam() const override { |
| 1145 return test_case_name_.c_str(); | 1145 return test_case_name_.c_str(); |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 virtual std::string OnMessage(const std::string& name, | 1148 virtual std::string OnMessage(const std::string& name, |
| 1149 const base::Value* value) OVERRIDE { | 1149 const base::Value* value) override { |
| 1150 if (name == "addAllUsers") { | 1150 if (name == "addAllUsers") { |
| 1151 AddAllUsers(); | 1151 AddAllUsers(); |
| 1152 return "true"; | 1152 return "true"; |
| 1153 } else if (name == "getWindowOwnerId") { | 1153 } else if (name == "getWindowOwnerId") { |
| 1154 chrome::MultiUserWindowManager* const window_manager = | 1154 chrome::MultiUserWindowManager* const window_manager = |
| 1155 chrome::MultiUserWindowManager::GetInstance(); | 1155 chrome::MultiUserWindowManager::GetInstance(); |
| 1156 extensions::AppWindowRegistry* const app_window_registry = | 1156 extensions::AppWindowRegistry* const app_window_registry = |
| 1157 extensions::AppWindowRegistry::Get(profile()); | 1157 extensions::AppWindowRegistry::Get(profile()); |
| 1158 DCHECK(window_manager); | 1158 DCHECK(window_manager); |
| 1159 DCHECK(app_window_registry); | 1159 DCHECK(app_window_registry); |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1210 AddAllUsers(); | 1210 AddAllUsers(); |
| 1211 | 1211 |
| 1212 // Sanity check that normal operations work in multi-profile setting as well. | 1212 // Sanity check that normal operations work in multi-profile setting as well. |
| 1213 set_test_case_name("keyboardCopyDrive"); | 1213 set_test_case_name("keyboardCopyDrive"); |
| 1214 StartTest(); | 1214 StartTest(); |
| 1215 } | 1215 } |
| 1216 | 1216 |
| 1217 template<GuestMode M> | 1217 template<GuestMode M> |
| 1218 class GalleryBrowserTestBase : public FileManagerBrowserTestBase { | 1218 class GalleryBrowserTestBase : public FileManagerBrowserTestBase { |
| 1219 public: | 1219 public: |
| 1220 virtual GuestMode GetGuestModeParam() const OVERRIDE { return M; } | 1220 virtual GuestMode GetGuestModeParam() const override { return M; } |
| 1221 virtual const char* GetTestCaseNameParam() const OVERRIDE { | 1221 virtual const char* GetTestCaseNameParam() const override { |
| 1222 return test_case_name_.c_str(); | 1222 return test_case_name_.c_str(); |
| 1223 } | 1223 } |
| 1224 | 1224 |
| 1225 protected: | 1225 protected: |
| 1226 virtual void SetUp() OVERRIDE { | 1226 virtual void SetUp() override { |
| 1227 AddScript("common/test_util_common.js"); | 1227 AddScript("common/test_util_common.js"); |
| 1228 AddScript("gallery/test_util.js"); | 1228 AddScript("gallery/test_util.js"); |
| 1229 FileManagerBrowserTestBase::SetUp(); | 1229 FileManagerBrowserTestBase::SetUp(); |
| 1230 } | 1230 } |
| 1231 | 1231 |
| 1232 virtual std::string OnMessage(const std::string& name, | 1232 virtual std::string OnMessage(const std::string& name, |
| 1233 const base::Value* value) OVERRIDE; | 1233 const base::Value* value) override; |
| 1234 | 1234 |
| 1235 virtual const char* GetTestManifestName() const OVERRIDE { | 1235 virtual const char* GetTestManifestName() const override { |
| 1236 return "gallery_test_manifest.json"; | 1236 return "gallery_test_manifest.json"; |
| 1237 } | 1237 } |
| 1238 | 1238 |
| 1239 void AddScript(const std::string& name) { | 1239 void AddScript(const std::string& name) { |
| 1240 scripts_.AppendString( | 1240 scripts_.AppendString( |
| 1241 "chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn/" + name); | 1241 "chrome-extension://ejhcmmdhhpdhhgmifplfmjobgegbibkn/" + name); |
| 1242 } | 1242 } |
| 1243 | 1243 |
| 1244 void set_test_case_name(const std::string& name) { | 1244 void set_test_case_name(const std::string& name) { |
| 1245 test_case_name_ = name; | 1245 test_case_name_ = name; |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1412 | 1412 |
| 1413 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { | 1413 IN_PROC_BROWSER_TEST_F(GalleryBrowserTest, ExposureImageOnDrive) { |
| 1414 AddScript("gallery/photo_editor.js"); | 1414 AddScript("gallery/photo_editor.js"); |
| 1415 set_test_case_name("exposureImageOnDrive"); | 1415 set_test_case_name("exposureImageOnDrive"); |
| 1416 StartTest(); | 1416 StartTest(); |
| 1417 } | 1417 } |
| 1418 | 1418 |
| 1419 template<GuestMode M> | 1419 template<GuestMode M> |
| 1420 class VideoPlayerBrowserTestBase : public FileManagerBrowserTestBase { | 1420 class VideoPlayerBrowserTestBase : public FileManagerBrowserTestBase { |
| 1421 public: | 1421 public: |
| 1422 virtual GuestMode GetGuestModeParam() const OVERRIDE { return M; } | 1422 virtual GuestMode GetGuestModeParam() const override { return M; } |
| 1423 virtual const char* GetTestCaseNameParam() const OVERRIDE { | 1423 virtual const char* GetTestCaseNameParam() const override { |
| 1424 return test_case_name_.c_str(); | 1424 return test_case_name_.c_str(); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 protected: | 1427 protected: |
| 1428 virtual void SetUp() OVERRIDE { | 1428 virtual void SetUp() override { |
| 1429 AddScript("common/test_util_common.js"); | 1429 AddScript("common/test_util_common.js"); |
| 1430 AddScript("video_player/test_util.js"); | 1430 AddScript("video_player/test_util.js"); |
| 1431 FileManagerBrowserTestBase::SetUp(); | 1431 FileManagerBrowserTestBase::SetUp(); |
| 1432 } | 1432 } |
| 1433 | 1433 |
| 1434 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | 1434 virtual void SetUpCommandLine(CommandLine* command_line) override { |
| 1435 command_line->AppendSwitch( | 1435 command_line->AppendSwitch( |
| 1436 chromeos::switches::kEnableVideoPlayerChromecastSupport); | 1436 chromeos::switches::kEnableVideoPlayerChromecastSupport); |
| 1437 FileManagerBrowserTestBase::SetUpCommandLine(command_line); | 1437 FileManagerBrowserTestBase::SetUpCommandLine(command_line); |
| 1438 } | 1438 } |
| 1439 | 1439 |
| 1440 virtual std::string OnMessage(const std::string& name, | 1440 virtual std::string OnMessage(const std::string& name, |
| 1441 const base::Value* value) OVERRIDE; | 1441 const base::Value* value) override; |
| 1442 | 1442 |
| 1443 virtual const char* GetTestManifestName() const OVERRIDE { | 1443 virtual const char* GetTestManifestName() const override { |
| 1444 return "video_player_test_manifest.json"; | 1444 return "video_player_test_manifest.json"; |
| 1445 } | 1445 } |
| 1446 | 1446 |
| 1447 void AddScript(const std::string& name) { | 1447 void AddScript(const std::string& name) { |
| 1448 scripts_.AppendString( | 1448 scripts_.AppendString( |
| 1449 "chrome-extension://ljoplibgfehghmibaoaepfagnmbbfiga/" + name); | 1449 "chrome-extension://ljoplibgfehghmibaoaepfagnmbbfiga/" + name); |
| 1450 } | 1450 } |
| 1451 | 1451 |
| 1452 void set_test_case_name(const std::string& name) { | 1452 void set_test_case_name(const std::string& name) { |
| 1453 test_case_name_ = name; | 1453 test_case_name_ = name; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1480 } | 1480 } |
| 1481 | 1481 |
| 1482 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { | 1482 IN_PROC_BROWSER_TEST_F(VideoPlayerBrowserTest, OpenSingleVideoOnDrive) { |
| 1483 AddScript("video_player/open_video_files.js"); | 1483 AddScript("video_player/open_video_files.js"); |
| 1484 set_test_case_name("openSingleVideoOnDrive"); | 1484 set_test_case_name("openSingleVideoOnDrive"); |
| 1485 StartTest(); | 1485 StartTest(); |
| 1486 } | 1486 } |
| 1487 | 1487 |
| 1488 } // namespace | 1488 } // namespace |
| 1489 } // namespace file_manager | 1489 } // namespace file_manager |
| OLD | NEW |