Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(48)

Side by Side Diff: chrome/browser/extensions/api/file_system/file_system_apitest.cc

Issue 139543005: Reject filesystem root entries as args for chrome.fileSystem functions. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 535 matching lines...) Expand 10 before | Expand all | Expand 10 after
546 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, 546 IN_PROC_BROWSER_TEST_F(FileSystemApiTest,
547 FileSystemApiGetWritableWithWriteTest) { 547 FileSystemApiGetWritableWithWriteTest) {
548 base::FilePath test_file = TempFilePath("writable.txt", true); 548 base::FilePath test_file = TempFilePath("writable.txt", true);
549 ASSERT_FALSE(test_file.empty()); 549 ASSERT_FALSE(test_file.empty());
550 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( 550 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
551 &test_file); 551 &test_file);
552 ASSERT_TRUE(RunPlatformAppTest( 552 ASSERT_TRUE(RunPlatformAppTest(
553 "api_test/file_system/get_writable_file_entry_with_write")) << message_; 553 "api_test/file_system/get_writable_file_entry_with_write")) << message_;
554 } 554 }
555 555
556 IN_PROC_BROWSER_TEST_F(FileSystemApiTest,
557 FileSystemApiGetWritableRootEntryTest) {
558 base::FilePath test_file = TempFilePath("writable.txt", true);
559 ASSERT_FALSE(test_file.empty());
560 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
561 &test_file);
562 ASSERT_TRUE(RunPlatformAppTest(
563 "api_test/file_system/get_writable_root_entry")) << message_;
564 }
565
556 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) { 566 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, FileSystemApiIsWritableTest) {
557 base::FilePath test_file = TempFilePath("writable.txt", true); 567 base::FilePath test_file = TempFilePath("writable.txt", true);
558 ASSERT_FALSE(test_file.empty()); 568 ASSERT_FALSE(test_file.empty());
559 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest( 569 FileSystemChooseEntryFunction::SkipPickerAndAlwaysSelectPathForTest(
560 &test_file); 570 &test_file);
561 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/is_writable_file_entry")) 571 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/is_writable_file_entry"))
562 << message_; 572 << message_;
563 } 573 }
564 574
565 IN_PROC_BROWSER_TEST_F(FileSystemApiTest, 575 IN_PROC_BROWSER_TEST_F(FileSystemApiTest,
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
627 AppInstallObserver observer( 637 AppInstallObserver observer(
628 base::Bind(AddSavedEntry, 638 base::Bind(AddSavedEntry,
629 test_directory, 639 test_directory,
630 true, 640 true,
631 apps::SavedFilesService::Get(profile()))); 641 apps::SavedFilesService::Get(profile())));
632 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/restore_directory")) 642 ASSERT_TRUE(RunPlatformAppTest("api_test/file_system/restore_directory"))
633 << message_; 643 << message_;
634 } 644 }
635 645
636 } // namespace extensions 646 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698