Chromium Code Reviews| 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 29 matching lines...) Expand all Loading... | |
| 40 enum EntryType { | 40 enum EntryType { |
| 41 FILE, | 41 FILE, |
| 42 DIRECTORY, | 42 DIRECTORY, |
| 43 }; | 43 }; |
| 44 | 44 |
| 45 enum SharedOption { | 45 enum SharedOption { |
| 46 NONE, | 46 NONE, |
| 47 SHARED, | 47 SHARED, |
| 48 }; | 48 }; |
| 49 | 49 |
| 50 enum TestSettings { | |
|
hashimoto
2013/06/03 08:15:34
nit: "-Settings" sounds like a name of a struct ra
hirono
2013/06/03 09:58:11
Yes, we can remove volume options.
I fixed.
| |
| 51 IN_GUEST_MODE = 0x1, | |
| 52 USE_LOCAL_VOLUME = 0x2, | |
| 53 USE_DRIVE_VOLUME = 0x4 | |
| 54 }; | |
| 55 | |
| 56 // This global operator is used from Google Test. | |
|
hashimoto
2013/06/03 08:15:34
IIUC this operator is used to generate names of in
hirono
2013/06/03 09:58:11
This operator is not used for the naming of tests.
| |
| 57 std::ostream& operator<<(std::ostream& os, const TestSettings& option) { | |
| 58 std::vector<std::string> labels; | |
| 59 if (option & IN_GUEST_MODE) | |
| 60 labels.push_back("IN_GUEST_MODE"); | |
| 61 if (option & USE_LOCAL_VOLUME) | |
| 62 labels.push_back("USE_LOCAL_VOLUME"); | |
| 63 if (option & USE_DRIVE_VOLUME) | |
| 64 labels.push_back("USE_DRIVE_VOLUME"); | |
| 65 if (labels.empty()) | |
| 66 labels.push_back("NO_OPTION"); | |
| 67 for (size_t i = 0; i < labels.size(); i++) { | |
| 68 os << labels[i]; | |
| 69 if (i != labels.size() - 1) | |
| 70 os << ", "; | |
| 71 } | |
| 72 return os; | |
| 73 } | |
| 74 | |
| 50 struct TestEntryInfo { | 75 struct TestEntryInfo { |
| 51 EntryType type; | 76 EntryType type; |
| 52 const char* source_file_name; // Source file name to be used as a prototype. | 77 const char* source_file_name; // Source file name to be used as a prototype. |
| 53 const char* target_name; // Target file or directory name. | 78 const char* target_name; // Target file or directory name. |
| 54 const char* mime_type; | 79 const char* mime_type; |
| 55 SharedOption shared_option; | 80 SharedOption shared_option; |
| 56 const char* last_modified_time_as_string; | 81 const char* last_modified_time_as_string; |
| 57 }; | 82 }; |
| 58 | 83 |
| 59 TestEntryInfo kTestEntrySetCommon[] = { | 84 TestEntryInfo kTestEntrySetCommon[] = { |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 228 time, | 253 time, |
| 229 google_apis::test_util::CreateCopyResultCallback(&error, | 254 google_apis::test_util::CreateCopyResultCallback(&error, |
| 230 &resource_entry)); | 255 &resource_entry)); |
| 231 base::MessageLoop::current()->RunUntilIdle(); | 256 base::MessageLoop::current()->RunUntilIdle(); |
| 232 ASSERT_TRUE(error == google_apis::HTTP_SUCCESS); | 257 ASSERT_TRUE(error == google_apis::HTTP_SUCCESS); |
| 233 ASSERT_TRUE(resource_entry); | 258 ASSERT_TRUE(resource_entry); |
| 234 CheckForUpdates(); | 259 CheckForUpdates(); |
| 235 } | 260 } |
| 236 | 261 |
| 237 virtual std::string GetName() const OVERRIDE { | 262 virtual std::string GetName() const OVERRIDE { |
| 238 return "Drive"; | 263 return kDriveVolume; |
| 239 } | 264 } |
| 240 | 265 |
| 241 // Creates a test file with the given spec. | 266 // Creates a test file with the given spec. |
| 242 // Serves |test_file_name| file. Pass an empty string for an empty file. | 267 // Serves |test_file_name| file. Pass an empty string for an empty file. |
| 243 void CreateFile(const std::string& source_file_name, | 268 void CreateFile(const std::string& source_file_name, |
| 244 const std::string& target_file_name, | 269 const std::string& target_file_name, |
| 245 const std::string& mime_type, | 270 const std::string& mime_type, |
| 246 bool shared_with_me, | 271 bool shared_with_me, |
| 247 const std::string& modification_time) { | 272 const std::string& modification_time) { |
| 248 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; | 273 google_apis::GDataErrorCode error = google_apis::GDATA_OTHER_ERROR; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 NULL); | 330 NULL); |
| 306 return integration_service_; | 331 return integration_service_; |
| 307 } | 332 } |
| 308 | 333 |
| 309 private: | 334 private: |
| 310 base::ScopedTempDir test_cache_root_; | 335 base::ScopedTempDir test_cache_root_; |
| 311 google_apis::FakeDriveService* fake_drive_service_; | 336 google_apis::FakeDriveService* fake_drive_service_; |
| 312 drive::DriveIntegrationService* integration_service_; | 337 drive::DriveIntegrationService* integration_service_; |
| 313 }; | 338 }; |
| 314 | 339 |
| 315 // The base test class. Used by FileManagerBrowserLocalTest, | 340 // The base test class. Used by FileManagerBrowserSimpleTest, |
| 316 // FileManagerBrowserDriveTest, and FileManagerBrowserTransferTest. | 341 // FileManagerBrowserComplexTest. |
|
hashimoto
2013/06/03 08:15:34
nit: Do we need to list all subclasses here? This
hirono
2013/06/03 09:58:11
Done.
| |
| 317 // The boolean parameter, retrieved by GetParam(), is true if testing in the | 342 class FileManagerBrowserTestBase : public ExtensionApiTest { |
| 318 // guest mode. See SetUpCommandLine() below for details. | |
| 319 class FileManagerBrowserTestBase : public ExtensionApiTest, | |
| 320 public ::testing::WithParamInterface<bool> { | |
| 321 protected: | 343 protected: |
| 344 explicit FileManagerBrowserTestBase(TestSettings test_settings) : | |
| 345 test_settings_(test_settings), | |
| 346 local_volume_(test_settings & USE_LOCAL_VOLUME ? | |
| 347 new LocalTestVolume(kDownloadsVolume) : NULL), | |
| 348 drive_volume_(test_settings & USE_DRIVE_VOLUME ? | |
| 349 new DriveTestVolume() : NULL) {} | |
| 350 | |
| 351 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE; | |
| 352 | |
| 353 virtual void SetUpOnMainThread() OVERRIDE; | |
| 354 | |
| 322 // Adds an incognito and guest-mode flags for tests in the guest mode. | 355 // Adds an incognito and guest-mode flags for tests in the guest mode. |
| 323 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; | 356 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE; |
| 324 | 357 |
| 325 // Loads our testing extension and sends it a string identifying the current | 358 // Loads our testing extension and sends it a string identifying the current |
| 326 // test. | 359 // test. |
| 327 void StartTest(const std::string& test_name); | 360 void StartTest(const std::string& test_name); |
| 328 | 361 |
| 329 // Creates test files and directories. | 362 // Creates test files and directories. |
| 330 void CreateTestEntries(TestVolume* volume, const TestEntryInfo* entries, | 363 void CreateTestEntries(TestVolume* volume, |
| 364 const TestEntryInfo* entries, | |
| 331 size_t num_entries); | 365 size_t num_entries); |
| 332 | 366 |
| 333 // Runs the file display test on the passed |volume|, shared by subclasses. | 367 // Replace '?' with the volume name. |
|
hashimoto
2013/06/03 08:15:34
This comment seems partly wrong because this funct
hirono
2013/06/03 09:58:11
Done.
| |
| 334 void DoTestFileDisplay(TestVolume* volume); | 368 std::string FormatTestName(const std::string& test_name); |
| 369 | |
| 370 // Returns test volume that is used mainly. | |
| 371 TestVolume* GetMainVolume(); | |
| 372 | |
| 373 private: | |
| 374 TestSettings test_settings_; | |
| 375 const scoped_ptr<LocalTestVolume> local_volume_; | |
| 376 const scoped_ptr<DriveTestVolume> drive_volume_; | |
| 335 }; | 377 }; |
| 336 | 378 |
| 379 void FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture() { | |
| 380 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); | |
| 381 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
| 382 if (drive_volume_) { | |
|
hashimoto
2013/06/03 08:15:34
nit: No need to have '{'
hirono
2013/06/03 09:58:11
Done.
| |
| 383 ASSERT_TRUE(drive_volume_->SetUp()); | |
| 384 } | |
| 385 } | |
| 386 | |
| 387 void FileManagerBrowserTestBase::SetUpOnMainThread() { | |
| 388 ExtensionApiTest::SetUpOnMainThread(); | |
| 389 if (local_volume_) { | |
| 390 ASSERT_TRUE(local_volume_->Mount(browser()->profile())); | |
| 391 CreateTestEntries(local_volume_.get(), | |
| 392 kTestEntrySetCommon, | |
| 393 arraysize(kTestEntrySetCommon)); | |
| 394 } | |
| 395 if (drive_volume_) { | |
| 396 CreateTestEntries(drive_volume_.get(), | |
| 397 kTestEntrySetCommon, | |
| 398 arraysize(kTestEntrySetCommon)); | |
| 399 // For testing Drive, create more entries with Drive specific attributes. | |
| 400 // TODO(haruki): Add a case for an entry cached by DriveCache. | |
| 401 CreateTestEntries(drive_volume_.get(), | |
| 402 kTestEntrySetDriveOnly, | |
| 403 arraysize(kTestEntrySetDriveOnly)); | |
| 404 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
| 405 } | |
| 406 } | |
| 407 | |
| 337 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { | 408 void FileManagerBrowserTestBase::SetUpCommandLine(CommandLine* command_line) { |
| 338 bool in_guest_mode = GetParam(); | 409 if (test_settings_ & IN_GUEST_MODE) { |
| 339 if (in_guest_mode) { | |
| 340 command_line->AppendSwitch(chromeos::switches::kGuestSession); | 410 command_line->AppendSwitch(chromeos::switches::kGuestSession); |
| 341 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); | 411 command_line->AppendSwitchNative(chromeos::switches::kLoginUser, ""); |
| 342 command_line->AppendSwitch(switches::kIncognito); | 412 command_line->AppendSwitch(switches::kIncognito); |
| 343 } | 413 } |
| 344 ExtensionApiTest::SetUpCommandLine(command_line); | 414 ExtensionApiTest::SetUpCommandLine(command_line); |
| 345 } | 415 } |
| 346 | 416 |
| 347 void FileManagerBrowserTestBase::StartTest(const std::string& test_name) { | 417 void FileManagerBrowserTestBase::StartTest(const std::string& test_name) { |
| 348 base::FilePath path = test_data_dir_.AppendASCII("file_manager_browsertest"); | 418 base::FilePath path = test_data_dir_.AppendASCII("file_manager_browsertest"); |
| 349 const extensions::Extension* extension = LoadExtensionAsComponent(path); | 419 const extensions::Extension* extension = LoadExtensionAsComponent(path); |
| 350 ASSERT_TRUE(extension); | 420 ASSERT_TRUE(extension); |
| 351 | 421 |
| 352 bool in_guest_mode = GetParam(); | 422 bool in_guest_mode = test_settings_ & IN_GUEST_MODE; |
| 353 ExtensionTestMessageListener listener( | 423 ExtensionTestMessageListener listener( |
| 354 in_guest_mode ? "which test guest" : "which test non-guest", true); | 424 in_guest_mode ? "which test guest" : "which test non-guest", true); |
| 355 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 425 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 356 listener.Reply(test_name); | 426 listener.Reply(test_name); |
| 357 } | 427 } |
| 358 | 428 |
| 359 void FileManagerBrowserTestBase::CreateTestEntries( | 429 void FileManagerBrowserTestBase::CreateTestEntries( |
| 360 TestVolume* volume, const TestEntryInfo* entries, size_t num_entries) { | 430 TestVolume* volume, const TestEntryInfo* entries, size_t num_entries) { |
| 361 for (size_t i = 0; i < num_entries; ++i) { | 431 for (size_t i = 0; i < num_entries; ++i) { |
| 362 volume->CreateEntry(entries[i]); | 432 volume->CreateEntry(entries[i]); |
| 363 } | 433 } |
| 364 } | 434 } |
| 365 | 435 |
| 366 void FileManagerBrowserTestBase::DoTestFileDisplay(TestVolume* volume) { | 436 std::string FileManagerBrowserTestBase::FormatTestName( |
| 437 const std::string& test_name) { | |
| 438 std::string result = test_name; | |
| 439 if (result.at(result.size() - 1) == '?') { | |
| 440 result.erase(result.size() - 1); | |
| 441 result.append(GetMainVolume()->GetName()); | |
| 442 } | |
| 443 return result; | |
| 444 } | |
| 445 | |
| 446 TestVolume* FileManagerBrowserTestBase::GetMainVolume() { | |
| 447 if (local_volume_) | |
|
hashimoto
2013/06/03 08:15:34
"return NULL" cannot happen, right?
Seems this fun
hirono
2013/06/03 09:58:11
This function is no longer needed.
I just remove i
| |
| 448 return local_volume_.get(); | |
| 449 else if (drive_volume_) | |
| 450 return drive_volume_.get(); | |
| 451 else | |
| 452 return NULL; | |
| 453 } | |
| 454 | |
| 455 // A test class test that needs specific operations. | |
| 456 class FileManagerBrowserComplexTest : | |
| 457 public FileManagerBrowserTestBase, | |
| 458 public ::testing::WithParamInterface<TestSettings> { | |
| 459 public: | |
| 460 FileManagerBrowserComplexTest() : | |
| 461 FileManagerBrowserTestBase(GetParam()) {} | |
| 462 }; | |
| 463 | |
| 464 IN_PROC_BROWSER_TEST_P(FileManagerBrowserComplexTest, | |
| 465 DoTestFileDisplay) { | |
|
hashimoto
2013/06/03 08:15:34
nit: "Do" and "Test" are redundant. (All code in t
hirono
2013/06/03 09:58:11
Done.
| |
| 367 ResultCatcher catcher; | 466 ResultCatcher catcher; |
| 368 ASSERT_NO_FATAL_FAILURE(StartTest("fileDisplay" + volume->GetName())); | 467 ASSERT_NO_FATAL_FAILURE(StartTest(FormatTestName("fileDisplay?"))); |
| 369 | 468 |
| 370 ExtensionTestMessageListener listener("initial check done", true); | 469 ExtensionTestMessageListener listener("initial check done", true); |
| 371 ASSERT_TRUE(listener.WaitUntilSatisfied()); | 470 ASSERT_TRUE(listener.WaitUntilSatisfied()); |
| 372 const TestEntryInfo entry = { | 471 const TestEntryInfo entry = { |
| 373 FILE, | 472 FILE, |
| 374 "music.ogg", // Prototype file name. | 473 "music.ogg", // Prototype file name. |
| 375 "newly added file.ogg", // Target file name. | 474 "newly added file.ogg", // Target file name. |
| 376 "audio/ogg", | 475 "audio/ogg", |
| 377 NONE, | 476 NONE, |
| 378 "4 Sep 1998 00:00:00" | 477 "4 Sep 1998 00:00:00" |
| 379 }; | 478 }; |
| 380 volume->CreateEntry(entry); | 479 GetMainVolume()->CreateEntry(entry); |
| 381 listener.Reply("file added"); | 480 listener.Reply("file added"); |
| 382 | 481 |
| 383 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 482 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 384 } | 483 } |
| 385 | 484 |
| 386 // A class to test local volumes. | 485 INSTANTIATE_TEST_CASE_P( |
| 387 class FileManagerBrowserLocalTest : public FileManagerBrowserTestBase { | 486 AllSettings, |
| 487 FileManagerBrowserComplexTest, | |
| 488 ::testing::Values(USE_LOCAL_VOLUME, | |
| 489 USE_LOCAL_VOLUME | IN_GUEST_MODE, | |
| 490 USE_DRIVE_VOLUME)); | |
| 491 | |
| 492 // A test class that just executes JavaScript unit test. | |
| 493 class FileManagerBrowserSimpleTest : | |
| 494 public FileManagerBrowserTestBase, | |
| 495 public ::testing::WithParamInterface<std::tr1::tuple<TestSettings, | |
| 496 const char*> > { | |
| 388 public: | 497 public: |
| 389 FileManagerBrowserLocalTest() : volume_("Downloads") {} | 498 FileManagerBrowserSimpleTest() : |
| 390 | 499 FileManagerBrowserTestBase(std::tr1::get<0>(GetParam())) {} |
| 391 protected: | |
| 392 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 393 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
| 394 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
| 395 } | |
| 396 | |
| 397 virtual void SetUpOnMainThread() OVERRIDE { | |
| 398 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
| 399 ASSERT_TRUE(volume_.Mount(browser()->profile())); | |
| 400 CreateTestEntries(&volume_, kTestEntrySetCommon, | |
| 401 arraysize(kTestEntrySetCommon)); | |
| 402 } | |
| 403 | |
| 404 LocalTestVolume volume_; | |
| 405 }; | 500 }; |
| 406 | 501 |
| 407 INSTANTIATE_TEST_CASE_P(InGuestMode, | 502 IN_PROC_BROWSER_TEST_P(FileManagerBrowserSimpleTest, |
| 408 FileManagerBrowserLocalTest, | 503 ExecuteJavaScriptTest) { |
|
hashimoto
2013/06/03 08:15:34
nit: "ExecuteJavaScriptTest" might be appropriate
hirono
2013/06/03 09:58:11
Done.
| |
| 409 ::testing::Values(true)); | |
| 410 | |
| 411 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
| 412 FileManagerBrowserLocalTest, | |
| 413 ::testing::Values(false)); | |
| 414 | |
| 415 // A class to test Drive's volumes | |
| 416 class FileManagerBrowserDriveTest : public FileManagerBrowserTestBase { | |
| 417 protected: | |
| 418 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 419 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
| 420 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
| 421 ASSERT_TRUE(volume_.SetUp()); | |
| 422 } | |
| 423 | |
| 424 virtual void SetUpOnMainThread() OVERRIDE { | |
| 425 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
| 426 CreateTestEntries(&volume_, kTestEntrySetCommon, | |
| 427 arraysize(kTestEntrySetCommon)); | |
| 428 // For testing Drive, create more entries with Drive specific attributes. | |
| 429 // TODO(haruki): Add a case for an entry cached by DriveCache. | |
| 430 CreateTestEntries(&volume_, kTestEntrySetDriveOnly, | |
| 431 arraysize(kTestEntrySetDriveOnly)); | |
| 432 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
| 433 } | |
| 434 | |
| 435 DriveTestVolume volume_; | |
| 436 }; | |
| 437 | |
| 438 // Don't test Drive in the guest mode as it's not supported. | |
| 439 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
| 440 FileManagerBrowserDriveTest, | |
| 441 ::testing::Values(false)); | |
| 442 | |
| 443 // A class to test both local and Drive's volumes. | |
| 444 class FileManagerBrowserTransferTest : public FileManagerBrowserTestBase { | |
| 445 public: | |
| 446 FileManagerBrowserTransferTest() : local_volume_("Downloads") {} | |
| 447 | |
| 448 protected: | |
| 449 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { | |
| 450 FileManagerBrowserTestBase::SetUpInProcessBrowserTestFixture(); | |
| 451 extensions::ComponentLoader::EnableBackgroundExtensionsForTesting(); | |
| 452 ASSERT_TRUE(drive_volume_.SetUp()); | |
| 453 } | |
| 454 | |
| 455 virtual void SetUpOnMainThread() OVERRIDE { | |
| 456 FileManagerBrowserTestBase::SetUpOnMainThread(); | |
| 457 ASSERT_TRUE(local_volume_.Mount(browser()->profile())); | |
| 458 CreateTestEntries(&local_volume_, kTestEntrySetCommon, | |
| 459 arraysize(kTestEntrySetCommon)); | |
| 460 CreateTestEntries(&drive_volume_, kTestEntrySetCommon, | |
| 461 arraysize(kTestEntrySetCommon)); | |
| 462 CreateTestEntries(&drive_volume_, kTestEntrySetDriveOnly, | |
| 463 arraysize(kTestEntrySetDriveOnly)); | |
| 464 drive_test_util::WaitUntilDriveMountPointIsAdded(browser()->profile()); | |
| 465 } | |
| 466 | |
| 467 LocalTestVolume local_volume_; | |
| 468 DriveTestVolume drive_volume_; | |
| 469 }; | |
| 470 | |
| 471 // FileManagerBrowserTransferTest depends on Drive and Drive is not supported in | |
| 472 // the guest mode. | |
| 473 INSTANTIATE_TEST_CASE_P(InNonGuestMode, | |
| 474 FileManagerBrowserTransferTest, | |
| 475 ::testing::Values(false)); | |
| 476 | |
| 477 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestFileDisplay) { | |
| 478 DoTestFileDisplay(&volume_); | |
| 479 } | |
| 480 | |
| 481 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestGalleryOpen) { | |
| 482 ResultCatcher catcher; | 504 ResultCatcher catcher; |
| 483 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 505 ASSERT_NO_FATAL_FAILURE( |
| 506 StartTest(FormatTestName(std::tr1::get<1>(GetParam())))); | |
| 484 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 507 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); |
| 485 } | 508 } |
| 486 | 509 |
| 487 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestKeyboardDelete) { | 510 INSTANTIATE_TEST_CASE_P( |
| 488 ResultCatcher catcher; | 511 OpenSpecialTypes, |
|
hashimoto
2013/06/03 08:15:34
Why OpenSpecialTypes and KeyboardOperation are lis
hirono
2013/06/03 09:58:11
Parameterized tests are not named, just numbered.
| |
| 489 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDownloads")); | 512 FileManagerBrowserSimpleTest, |
| 490 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 513 ::testing::Combine( |
| 491 } | 514 ::testing::Values( |
|
hashimoto
2013/06/03 08:15:34
nit: "USE_LOCAL_VOLUME" can be in this line? The s
hirono
2013/06/03 09:58:11
Done.
| |
| 515 USE_LOCAL_VOLUME, | |
| 516 USE_LOCAL_VOLUME | IN_GUEST_MODE, | |
| 517 USE_DRIVE_VOLUME), | |
| 518 ::testing::Values("videoOpen?", "audioOpen?"))); | |
| 492 | 519 |
| 493 // Disabled temporarily since fails on Linux Chromium OS ASAN Tests (2). | 520 INSTANTIATE_TEST_CASE_P( |
| 494 // TODO(mtomasz): crbug.com/243611. | 521 GalleryOpen, |
| 495 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, DISABLED_TestGalleryOpen) { | 522 FileManagerBrowserSimpleTest, |
| 496 ResultCatcher catcher; | 523 ::testing::Combine( |
| 497 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 524 ::testing::Values( |
| 498 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 525 USE_LOCAL_VOLUME, |
| 499 } | 526 USE_LOCAL_VOLUME | IN_GUEST_MODE |
| 527 // Disabled temporarily since fails on Linux Chromium OS ASAN | |
| 528 // Tests (2). TODO(mtomasz): crbug.com/243611. | |
| 529 // USE_DRIVE_VOLUME | |
| 530 ), | |
| 531 ::testing::Values("galleryOpen?"))); | |
| 500 | 532 |
| 501 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestAudioOpen) { | 533 INSTANTIATE_TEST_CASE_P( |
| 502 ResultCatcher catcher; | 534 KeyboardOperation, |
| 503 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 535 FileManagerBrowserSimpleTest, |
| 504 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();} | 536 ::testing::Combine( |
| 537 ::testing::Values( | |
| 538 USE_LOCAL_VOLUME, | |
| 539 USE_LOCAL_VOLUME | IN_GUEST_MODE, | |
| 540 USE_DRIVE_VOLUME), | |
| 541 ::testing::Values("keyboardDelete?", "keyboardCopy?"))); | |
| 505 | 542 |
| 506 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAudioOpen) { | 543 INSTANTIATE_TEST_CASE_P( |
| 507 ResultCatcher catcher; | 544 DriveSpecific, |
| 508 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 545 FileManagerBrowserSimpleTest, |
| 509 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 546 ::testing::Combine( |
| 510 } | 547 ::testing::Values(USE_DRIVE_VOLUME), |
| 548 ::testing::Values( | |
| 549 "openSidebarRecent", | |
| 550 "openSidebarOffline", | |
| 551 "openSidebarSharedWithMe", | |
| 552 "autocomplete"))); | |
| 511 | 553 |
| 512 IN_PROC_BROWSER_TEST_P(FileManagerBrowserLocalTest, TestVideoOpen) { | 554 INSTANTIATE_TEST_CASE_P( |
| 513 ResultCatcher catcher; | 555 Transfer, |
| 514 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDownloads")); | 556 FileManagerBrowserSimpleTest, |
| 515 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 557 ::testing::Combine( |
| 516 } | 558 ::testing::Values((TestSettings)(USE_LOCAL_VOLUME | USE_DRIVE_VOLUME)), |
|
hashimoto
2013/06/03 08:15:34
Please don't use C-style cast.
Also, since the typ
hirono
2013/06/03 09:58:11
This bit operation is no longer used.
| |
| 517 | 559 ::testing::Values( |
| 518 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestVideoOpen) { | 560 "transferFromDriveToDownloads", |
| 519 ResultCatcher catcher; | 561 "transferFromDownloadsToDrive", |
| 520 ASSERT_NO_FATAL_FAILURE(StartTest("galleryOpenDrive")); | 562 "transferFromSharedToDownloads", |
| 521 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | 563 "transferFromSharedToDrive", |
| 522 } | 564 "transferFromRecentToDownloads", |
| 523 | 565 "transferFromRecentToDrive", |
| 524 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardCopy) { | 566 "transferFromOfflineToDownloads", |
| 525 ResultCatcher catcher; | 567 "transferFromOfflineToDrive"))); |
| 526 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardCopyDrive")); | |
| 527 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 528 } | |
| 529 | |
| 530 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestKeyboardDelete) { | |
| 531 ResultCatcher catcher; | |
| 532 ASSERT_NO_FATAL_FAILURE(StartTest("keyboardDeleteDrive")); | |
| 533 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 534 } | |
| 535 | |
| 536 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenRecent) { | |
| 537 ResultCatcher catcher; | |
| 538 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarRecent")); | |
| 539 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 540 } | |
| 541 | |
| 542 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenOffline) { | |
| 543 ResultCatcher catcher; | |
| 544 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarOffline")); | |
| 545 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 546 } | |
| 547 | |
| 548 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestOpenSharedWithMe) { | |
| 549 ResultCatcher catcher; | |
| 550 ASSERT_NO_FATAL_FAILURE(StartTest("openSidebarSharedWithMe")); | |
| 551 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 552 } | |
| 553 | |
| 554 IN_PROC_BROWSER_TEST_P(FileManagerBrowserDriveTest, TestAutocomplete) { | |
| 555 ResultCatcher catcher; | |
| 556 ASSERT_NO_FATAL_FAILURE(StartTest("autocomplete")); | |
| 557 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 558 } | |
| 559 | |
| 560 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 561 TransferFromDriveToDownloads) { | |
| 562 ResultCatcher catcher; | |
| 563 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromDriveToDownloads")); | |
| 564 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 565 } | |
| 566 | |
| 567 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 568 TransferFromDownloadsToDrive) { | |
| 569 ResultCatcher catcher; | |
| 570 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromDownloadsToDrive")); | |
| 571 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 572 } | |
| 573 | |
| 574 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 575 TransferFromSharedToDownloads) { | |
| 576 ResultCatcher catcher; | |
| 577 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromSharedToDownloads")); | |
| 578 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 579 } | |
| 580 | |
| 581 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 582 TransferFromSharedToDrive) { | |
| 583 ResultCatcher catcher; | |
| 584 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromSharedToDrive")); | |
| 585 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 586 } | |
| 587 | |
| 588 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 589 TransferFromRecentToDownloads) { | |
| 590 ResultCatcher catcher; | |
| 591 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromRecentToDownloads")); | |
| 592 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 593 } | |
| 594 | |
| 595 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 596 TransferFromRecentToDrive) { | |
| 597 ResultCatcher catcher; | |
| 598 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromRecentToDrive")); | |
| 599 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 600 } | |
| 601 | |
| 602 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 603 TransferFromOfflineToDownloads) { | |
| 604 ResultCatcher catcher; | |
| 605 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDownloads")); | |
| 606 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 607 } | |
| 608 | |
| 609 IN_PROC_BROWSER_TEST_P(FileManagerBrowserTransferTest, | |
| 610 TransferFromOfflineToDrive) { | |
| 611 ResultCatcher catcher; | |
| 612 ASSERT_NO_FATAL_FAILURE(StartTest("transferFromOfflineToDrive")); | |
| 613 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); | |
| 614 } | |
| 615 | 568 |
| 616 } // namespace | 569 } // namespace |
| OLD | NEW |