| 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 <memory> | 5 #include <memory> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "chrome/browser/extensions/extension_browsertest.h" | 9 #include "chrome/browser/extensions/extension_browsertest.h" |
| 10 #include "chrome/browser/extensions/webstore_startup_installer.h" | 10 #include "chrome/browser/extensions/webstore_startup_installer.h" |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 | 82 |
| 83 class HotwordInstallerBrowserTest : public ExtensionBrowserTest { | 83 class HotwordInstallerBrowserTest : public ExtensionBrowserTest { |
| 84 public: | 84 public: |
| 85 HotwordInstallerBrowserTest() {} | 85 HotwordInstallerBrowserTest() {} |
| 86 ~HotwordInstallerBrowserTest() override {} | 86 ~HotwordInstallerBrowserTest() override {} |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 DISALLOW_COPY_AND_ASSIGN(HotwordInstallerBrowserTest); | 89 DISALLOW_COPY_AND_ASSIGN(HotwordInstallerBrowserTest); |
| 90 }; | 90 }; |
| 91 | 91 |
| 92 // Disabled on Windows due to https://crbug.com/717648. Since the installation |
| 93 // is still in progress during shutdown, file handles may still be open. This |
| 94 // causes TestingProfile to crash during shutdown. |
| 95 #if defined(OS_WIN) |
| 96 #define Maybe_AbortInstallOnShutdown DISABLED_AbortInstallOnShutdown |
| 97 #else |
| 98 #define Maybe_AbortInstallOnShutdown AbortInstallOnShutdown |
| 99 #endif |
| 92 // Test that installing to a non-existent URL (which should hang) does not | 100 // Test that installing to a non-existent URL (which should hang) does not |
| 93 // crash. This test is successful if it does not crash and trigger any DCHECKS. | 101 // crash. This test is successful if it does not crash and trigger any DCHECKS. |
| 94 IN_PROC_BROWSER_TEST_F(HotwordInstallerBrowserTest, AbortInstallOnShutdown) { | 102 IN_PROC_BROWSER_TEST_F(HotwordInstallerBrowserTest, |
| 103 Maybe_AbortInstallOnShutdown) { |
| 95 TestingProfile test_profile; | 104 TestingProfile test_profile; |
| 96 HotwordServiceFactory* hotword_service_factory = | 105 HotwordServiceFactory* hotword_service_factory = |
| 97 HotwordServiceFactory::GetInstance(); | 106 HotwordServiceFactory::GetInstance(); |
| 98 MockHotwordService* hotword_service = static_cast<MockHotwordService*>( | 107 MockHotwordService* hotword_service = static_cast<MockHotwordService*>( |
| 99 hotword_service_factory->SetTestingFactoryAndUse( | 108 hotword_service_factory->SetTestingFactoryAndUse( |
| 100 &test_profile, BuildMockHotwordService)); | 109 &test_profile, BuildMockHotwordService)); |
| 101 hotword_service->InstallHotwordExtensionFromWebstore(1); | 110 hotword_service->InstallHotwordExtensionFromWebstore(1); |
| 102 } | 111 } |
| 103 | 112 |
| 104 } // namespace extensions | 113 } // namespace extensions |
| OLD | NEW |