OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/apps/drive/drive_app_provider.h" | 5 #include "chrome/browser/apps/drive/drive_app_provider.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); | 70 fake_drive_service_->LoadAppListForDriveApi("drive/applist_empty.json"); |
71 apps_registry_.reset( | 71 apps_registry_.reset( |
72 new drive::DriveAppRegistry(fake_drive_service_.get())); | 72 new drive::DriveAppRegistry(fake_drive_service_.get())); |
73 | 73 |
74 provider_.reset(new DriveAppProvider(profile())); | 74 provider_.reset(new DriveAppProvider(profile())); |
75 provider_->SetDriveServiceBridgeForTest( | 75 provider_->SetDriveServiceBridgeForTest( |
76 make_scoped_ptr(new TestDriveServiceBridge(apps_registry_.get())) | 76 make_scoped_ptr(new TestDriveServiceBridge(apps_registry_.get())) |
77 .PassAs<DriveServiceBridge>()); | 77 .PassAs<DriveServiceBridge>()); |
78 } | 78 } |
79 | 79 |
80 virtual void CleanUpOnMainThread() OVERRIDE { | 80 virtual void TearDownOnMainThread() OVERRIDE { |
81 provider_.reset(); | 81 provider_.reset(); |
82 apps_registry_.reset(); | 82 apps_registry_.reset(); |
83 fake_drive_service_.reset(); | 83 fake_drive_service_.reset(); |
84 | 84 |
85 ExtensionBrowserTest::CleanUpOnMainThread(); | 85 ExtensionBrowserTest::TearDownOnMainThread(); |
86 } | 86 } |
87 | 87 |
88 const Extension* InstallChromeApp(int expected_change) { | 88 const Extension* InstallChromeApp(int expected_change) { |
89 base::FilePath test_data_path; | 89 base::FilePath test_data_path; |
90 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_data_path)) { | 90 if (!PathService::Get(chrome::DIR_TEST_DATA, &test_data_path)) { |
91 ADD_FAILURE(); | 91 ADD_FAILURE(); |
92 return NULL; | 92 return NULL; |
93 } | 93 } |
94 test_data_path = | 94 test_data_path = |
95 test_data_path.AppendASCII("extensions").AppendASCII("hosted_app.crx"); | 95 test_data_path.AppendASCII("extensions").AppendASCII("hosted_app.crx"); |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
444 InstallUserUrlApp(kLaunchUrl); | 444 InstallUserUrlApp(kLaunchUrl); |
445 EXPECT_FALSE(mapping()->IsChromeAppGenerated(url_app_id)); | 445 EXPECT_FALSE(mapping()->IsChromeAppGenerated(url_app_id)); |
446 | 446 |
447 fake_drive_service()->RemoveAppByProductId(kChromeAppId); | 447 fake_drive_service()->RemoveAppByProductId(kChromeAppId); |
448 RefreshDriveAppRegistry(); | 448 RefreshDriveAppRegistry(); |
449 | 449 |
450 // Url app is still present after the Drive app is disconnected. | 450 // Url app is still present after the Drive app is disconnected. |
451 EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById( | 451 EXPECT_TRUE(ExtensionRegistry::Get(profile())->GetExtensionById( |
452 url_app_id, ExtensionRegistry::EVERYTHING)); | 452 url_app_id, ExtensionRegistry::EVERYTHING)); |
453 } | 453 } |
OLD | NEW |