| 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 "chrome/browser/extensions/crx_installer.h" | 5 #include "chrome/browser/extensions/crx_installer.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 LOG(ERROR) << "PackAndInstallExtension: Getting download manager"; | 366 LOG(ERROR) << "PackAndInstallExtension: Getting download manager"; |
| 367 content::DownloadManager* download_manager = | 367 content::DownloadManager* download_manager = |
| 368 content::BrowserContext::GetDownloadManager(browser()->profile()); | 368 content::BrowserContext::GetDownloadManager(browser()->profile()); |
| 369 | 369 |
| 370 LOG(ERROR) << "PackAndInstallExtension: Setting observer"; | 370 LOG(ERROR) << "PackAndInstallExtension: Setting observer"; |
| 371 std::unique_ptr<content::DownloadTestObserver> observer( | 371 std::unique_ptr<content::DownloadTestObserver> observer( |
| 372 new content::DownloadTestObserverTerminal( | 372 new content::DownloadTestObserverTerminal( |
| 373 download_manager, kNumDownloadsExpected, | 373 download_manager, kNumDownloadsExpected, |
| 374 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); | 374 content::DownloadTestObserver::ON_DANGEROUS_DOWNLOAD_ACCEPT)); |
| 375 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; | 375 LOG(ERROR) << "PackAndInstallExtension: Navigating to URL"; |
| 376 ui_test_utils::NavigateToURLWithDisposition(browser(), url, CURRENT_TAB, | 376 ui_test_utils::NavigateToURLWithDisposition( |
| 377 browser(), url, WindowOpenDisposition::CURRENT_TAB, |
| 377 ui_test_utils::BROWSER_TEST_NONE); | 378 ui_test_utils::BROWSER_TEST_NONE); |
| 378 | 379 |
| 379 EXPECT_TRUE(WaitForCrxInstallerDone()); | 380 EXPECT_TRUE(WaitForCrxInstallerDone()); |
| 380 LOG(ERROR) << "PackAndInstallExtension: Extension install"; | 381 LOG(ERROR) << "PackAndInstallExtension: Extension install"; |
| 381 EXPECT_TRUE(mock_prompt->confirmation_requested()); | 382 EXPECT_TRUE(mock_prompt->confirmation_requested()); |
| 382 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; | 383 LOG(ERROR) << "PackAndInstallExtension: Extension install confirmed"; |
| 383 } | 384 } |
| 384 | 385 |
| 385 // Tests that scopes are only granted if |record_oauth2_grant_| on the prompt is | 386 // Tests that scopes are only granted if |record_oauth2_grant_| on the prompt is |
| 386 // true. | 387 // true. |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 690 EXPECT_TRUE(WaitForCrxInstallerDone()); | 691 EXPECT_TRUE(WaitForCrxInstallerDone()); |
| 691 const Extension* extension = installer->extension(); | 692 const Extension* extension = installer->extension(); |
| 692 ASSERT_TRUE(extension); | 693 ASSERT_TRUE(extension); |
| 693 ASSERT_EQ(extension_id, extension->id()); | 694 ASSERT_EQ(extension_id, extension->id()); |
| 694 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); | 695 EXPECT_TRUE(ExtensionPrefs::Get(profile())->AllowFileAccess(extension_id)); |
| 695 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); | 696 EXPECT_TRUE(extension->creation_flags() & Extension::ALLOW_FILE_ACCESS); |
| 696 } | 697 } |
| 697 } | 698 } |
| 698 | 699 |
| 699 } // namespace extensions | 700 } // namespace extensions |
| OLD | NEW |