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

Side by Side Diff: chrome/browser/chromeos/drive/drive_file_system_unittest.cc

Issue 12039005: drive: Deal with the root directory in the same way as others in MoveOperation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. Created 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system/move_operation.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/chromeos/drive/drive_file_system.h" 5 #include "chrome/browser/chromeos/drive/drive_file_system.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 1424 matching lines...) Expand 10 before | Expand all | Expand 10 after
1435 1435
1436 ASSERT_TRUE(EntryExists(dest_parent_path)); 1436 ASSERT_TRUE(EntryExists(dest_parent_path));
1437 scoped_ptr<DriveEntryProto> dest_parent_proto = GetEntryInfoByPathSync( 1437 scoped_ptr<DriveEntryProto> dest_parent_proto = GetEntryInfoByPathSync(
1438 dest_parent_path); 1438 dest_parent_path);
1439 ASSERT_TRUE(dest_parent_proto.get()); 1439 ASSERT_TRUE(dest_parent_proto.get());
1440 ASSERT_TRUE(dest_parent_proto->file_info().is_directory()); 1440 ASSERT_TRUE(dest_parent_proto->file_info().is_directory());
1441 EXPECT_FALSE(dest_parent_proto->content_url().empty()); 1441 EXPECT_FALSE(dest_parent_proto->content_url().empty());
1442 1442
1443 // Expect notification for both source and destination directories. 1443 // Expect notification for both source and destination directories.
1444 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( 1444 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
1445 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(1); 1445 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(2);
1446 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( 1446 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
1447 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); 1447 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
1448 1448
1449 DriveFileError error = DRIVE_FILE_ERROR_FAILED; 1449 DriveFileError error = DRIVE_FILE_ERROR_FAILED;
1450 file_system_->Move( 1450 file_system_->Move(
1451 src_file_path, 1451 src_file_path,
1452 dest_file_path, 1452 dest_file_path,
1453 base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error)); 1453 base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error));
1454 google_apis::test_util::RunBlockingPoolTask(); 1454 google_apis::test_util::RunBlockingPoolTask();
1455 EXPECT_EQ(DRIVE_FILE_OK, error); 1455 EXPECT_EQ(DRIVE_FILE_OK, error);
(...skipping 21 matching lines...) Expand all
1477 1477
1478 ASSERT_TRUE(EntryExists(src_parent_path)); 1478 ASSERT_TRUE(EntryExists(src_parent_path));
1479 scoped_ptr<DriveEntryProto> src_parent_proto = GetEntryInfoByPathSync( 1479 scoped_ptr<DriveEntryProto> src_parent_proto = GetEntryInfoByPathSync(
1480 src_parent_path); 1480 src_parent_path);
1481 ASSERT_TRUE(src_parent_proto.get()); 1481 ASSERT_TRUE(src_parent_proto.get());
1482 ASSERT_TRUE(src_parent_proto->file_info().is_directory()); 1482 ASSERT_TRUE(src_parent_proto->file_info().is_directory());
1483 EXPECT_FALSE(src_parent_proto->content_url().empty()); 1483 EXPECT_FALSE(src_parent_proto->content_url().empty());
1484 1484
1485 // Expect notification for both source and destination directories. 1485 // Expect notification for both source and destination directories.
1486 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( 1486 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
1487 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(1); 1487 Eq(FilePath(FILE_PATH_LITERAL("drive"))))).Times(2);
1488 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged( 1488 EXPECT_CALL(*mock_directory_observer_, OnDirectoryChanged(
1489 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1); 1489 Eq(FilePath(FILE_PATH_LITERAL("drive/Directory 1"))))).Times(1);
1490 1490
1491 DriveFileError error = DRIVE_FILE_ERROR_FAILED; 1491 DriveFileError error = DRIVE_FILE_ERROR_FAILED;
1492 file_system_->Move( 1492 file_system_->Move(
1493 src_file_path, 1493 src_file_path,
1494 dest_file_path, 1494 dest_file_path,
1495 base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error)); 1495 base::Bind(&test_util::CopyErrorCodeFromFileOperationCallback, &error));
1496 google_apis::test_util::RunBlockingPoolTask(); 1496 google_apis::test_util::RunBlockingPoolTask();
1497 EXPECT_EQ(DRIVE_FILE_OK, error); 1497 EXPECT_EQ(DRIVE_FILE_OK, error);
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
2393 2393
2394 // An app for foo.ext_1 should now be found, as the registry was loaded. 2394 // An app for foo.ext_1 should now be found, as the registry was loaded.
2395 drive_webapps_registry_->GetWebAppsForFile( 2395 drive_webapps_registry_->GetWebAppsForFile(
2396 FilePath(FILE_PATH_LITERAL("foo.ext_1")), 2396 FilePath(FILE_PATH_LITERAL("foo.ext_1")),
2397 "" /* mime_type */, 2397 "" /* mime_type */,
2398 &apps); 2398 &apps);
2399 EXPECT_EQ(1U, apps.size()); 2399 EXPECT_EQ(1U, apps.size());
2400 } 2400 }
2401 2401
2402 } // namespace drive 2402 } // namespace drive
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/drive/file_system/move_operation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698