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 // MediaFileSystemRegistry unit tests. | 5 // MediaFileSystemRegistry unit tests. |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 ////////////////// | 425 ////////////////// |
426 | 426 |
427 ProfileState::ProfileState( | 427 ProfileState::ProfileState( |
428 MockProfileSharedRenderProcessHostFactory* rph_factory) | 428 MockProfileSharedRenderProcessHostFactory* rph_factory) |
429 : num_comparisons_(0), | 429 : num_comparisons_(0), |
430 profile_(new TestingProfile()) { | 430 profile_(new TestingProfile()) { |
431 extensions::TestExtensionSystem* extension_system( | 431 extensions::TestExtensionSystem* extension_system( |
432 static_cast<extensions::TestExtensionSystem*>( | 432 static_cast<extensions::TestExtensionSystem*>( |
433 extensions::ExtensionSystem::Get(profile_.get()))); | 433 extensions::ExtensionSystem::Get(profile_.get()))); |
434 extension_system->CreateExtensionService( | 434 extension_system->CreateExtensionService( |
435 CommandLine::ForCurrentProcess(), base::FilePath(), false); | 435 base::CommandLine::ForCurrentProcess(), base::FilePath(), false); |
436 | 436 |
437 std::vector<std::string> all_permissions; | 437 std::vector<std::string> all_permissions; |
438 all_permissions.push_back("allAutoDetected"); | 438 all_permissions.push_back("allAutoDetected"); |
439 all_permissions.push_back("read"); | 439 all_permissions.push_back("read"); |
440 std::vector<std::string> read_permissions; | 440 std::vector<std::string> read_permissions; |
441 read_permissions.push_back("read"); | 441 read_permissions.push_back("read"); |
442 | 442 |
443 all_permission_extension_ = | 443 all_permission_extension_ = |
444 AddMediaGalleriesApp("all", all_permissions, profile_.get()); | 444 AddMediaGalleriesApp("all", all_permissions, profile_.get()); |
445 regular_permission_extension_ = | 445 regular_permission_extension_ = |
(...skipping 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1070 fs_info.begin()->second.fsid).empty()); | 1070 fs_info.begin()->second.fsid).empty()); |
1071 | 1071 |
1072 // Revoke permission and ensure that the file system is revoked. | 1072 // Revoke permission and ensure that the file system is revoked. |
1073 SetGalleryPermission(profile_state, | 1073 SetGalleryPermission(profile_state, |
1074 profile_state->regular_permission_extension(), | 1074 profile_state->regular_permission_extension(), |
1075 device_id, | 1075 device_id, |
1076 false /*has access*/); | 1076 false /*has access*/); |
1077 EXPECT_TRUE(test_file_system_context()->GetRegisteredPath( | 1077 EXPECT_TRUE(test_file_system_context()->GetRegisteredPath( |
1078 fs_info.begin()->second.fsid).empty()); | 1078 fs_info.begin()->second.fsid).empty()); |
1079 } | 1079 } |
OLD | NEW |