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 "apps/saved_files_service.h" | 5 #include "apps/saved_files_service.h" |
6 #include "base/file_util.h" | 6 #include "base/file_util.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
9 #include "chrome/browser/apps/app_browsertest_util.h" | 9 #include "chrome/browser/apps/app_browsertest_util.h" |
10 #include "chrome/browser/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
(...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
586 ASSERT_FALSE(test_file.empty()); | 586 ASSERT_FALSE(test_file.empty()); |
587 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 587 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
588 &test_file); | 588 &test_file); |
589 ASSERT_TRUE(RunPlatformAppTest( | 589 ASSERT_TRUE(RunPlatformAppTest( |
590 "api_test/file_system/retain_entry")) << message_; | 590 "api_test/file_system/retain_entry")) << message_; |
591 std::vector<apps::SavedFileEntry> file_entries = apps::SavedFilesService::Get( | 591 std::vector<apps::SavedFileEntry> file_entries = apps::SavedFilesService::Get( |
592 profile())->GetAllFileEntries(GetSingleLoadedExtension()->id()); | 592 profile())->GetAllFileEntries(GetSingleLoadedExtension()->id()); |
593 ASSERT_EQ(1u, file_entries.size()); | 593 ASSERT_EQ(1u, file_entries.size()); |
594 EXPECT_EQ(test_file, file_entries[0].path); | 594 EXPECT_EQ(test_file, file_entries[0].path); |
595 EXPECT_EQ(1, file_entries[0].sequence_number); | 595 EXPECT_EQ(1, file_entries[0].sequence_number); |
| 596 EXPECT_FALSE(file_entries[0].is_directory); |
596 } | 597 } |
597 | 598 |
598 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiRetainDirectoryEntry) { | 599 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiRetainDirectoryEntry) { |
599 base::FilePath test_file = TempFilePath("open_existing.txt", true); | 600 base::FilePath test_file = TempFilePath("open_existing.txt", true); |
600 ASSERT_FALSE(test_file.empty()); | 601 ASSERT_FALSE(test_file.empty()); |
601 base::FilePath test_directory = test_file.DirName(); | 602 base::FilePath test_directory = test_file.DirName(); |
602 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( | 603 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( |
603 &test_directory); | 604 &test_directory); |
604 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/retain_directory")) | 605 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/retain_directory")) |
605 << message_; | 606 << message_; |
(...skipping 28 matching lines...) Expand all Loading... |
634 AppInstallObserver observer( | 635 AppInstallObserver observer( |
635 base::Bind(AddSavedEntry, | 636 base::Bind(AddSavedEntry, |
636 test_directory, | 637 test_directory, |
637 true, | 638 true, |
638 apps::SavedFilesService::Get(profile()))); | 639 apps::SavedFilesService::Get(profile()))); |
639 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/restore_directory")) | 640 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/restore_directory")) |
640 << message_; | 641 << message_; |
641 } | 642 } |
642 | 643 |
643 } // namespace extensions | 644 } // namespace extensions |
OLD | NEW |