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 <stddef.h> | 5 #include <stddef.h> |
6 | 6 |
7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
8 #include "base/files/scoped_temp_dir.h" | 8 #include "base/files/scoped_temp_dir.h" |
9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
10 #include "base/threading/sequenced_worker_pool.h" | 10 #include "base/threading/sequenced_worker_pool.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 UninstallWhilePromptBeingShown) { | 187 UninstallWhilePromptBeingShown) { |
188 const Extension* extension = InstallAndUpdateIncreasingPermissionsExtension(); | 188 const Extension* extension = InstallAndUpdateIncreasingPermissionsExtension(); |
189 ASSERT_TRUE(extension); | 189 ASSERT_TRUE(extension); |
190 ASSERT_TRUE(GetExtensionDisabledGlobalError()); | 190 ASSERT_TRUE(GetExtensionDisabledGlobalError()); |
191 | 191 |
192 // Navigate a tab to the disabled extension, it will show a permission | 192 // Navigate a tab to the disabled extension, it will show a permission |
193 // increase dialog. | 193 // increase dialog. |
194 GURL url = extension->GetResourceURL(""); | 194 GURL url = extension->GetResourceURL(""); |
195 int starting_tab_count = browser()->tab_strip_model()->count(); | 195 int starting_tab_count = browser()->tab_strip_model()->count(); |
196 ui_test_utils::NavigateToURLWithDisposition( | 196 ui_test_utils::NavigateToURLWithDisposition( |
197 browser(), url, NEW_FOREGROUND_TAB, | 197 browser(), url, WindowOpenDisposition::NEW_FOREGROUND_TAB, |
198 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); | 198 ui_test_utils::BROWSER_TEST_WAIT_FOR_NAVIGATION); |
199 int tab_count = browser()->tab_strip_model()->count(); | 199 int tab_count = browser()->tab_strip_model()->count(); |
200 EXPECT_EQ(starting_tab_count + 1, tab_count); | 200 EXPECT_EQ(starting_tab_count + 1, tab_count); |
201 | 201 |
202 // Uninstall the extension while the dialog is being shown. | 202 // Uninstall the extension while the dialog is being shown. |
203 // Although the dialog is modal, a user can still uninstall the extension by | 203 // Although the dialog is modal, a user can still uninstall the extension by |
204 // other means, e.g. if the user had two browser windows open they can use the | 204 // other means, e.g. if the user had two browser windows open they can use the |
205 // second browser window that does not contain the modal dialog, navigate to | 205 // second browser window that does not contain the modal dialog, navigate to |
206 // chrome://extensions and uninstall the extension. | 206 // chrome://extensions and uninstall the extension. |
207 UninstallExtension(extension->id()); | 207 UninstallExtension(extension->id()); |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 | 317 |
318 const Extension* extension = service_->GetExtensionById(extension_id, true); | 318 const Extension* extension = service_->GetExtensionById(extension_id, true); |
319 ASSERT_TRUE(extension); | 319 ASSERT_TRUE(extension); |
320 EXPECT_EQ("2", extension->VersionString()); | 320 EXPECT_EQ("2", extension->VersionString()); |
321 EXPECT_EQ(1u, registry_->disabled_extensions().size()); | 321 EXPECT_EQ(1u, registry_->disabled_extensions().size()); |
322 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, | 322 EXPECT_EQ(Extension::DISABLE_REMOTE_INSTALL, |
323 ExtensionPrefs::Get(service_->profile()) | 323 ExtensionPrefs::Get(service_->profile()) |
324 ->GetDisableReasons(extension_id)); | 324 ->GetDisableReasons(extension_id)); |
325 EXPECT_TRUE(GetExtensionDisabledGlobalError()); | 325 EXPECT_TRUE(GetExtensionDisabledGlobalError()); |
326 } | 326 } |
OLD | NEW |