Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: chrome/browser/ui/browser_browsertest.cc

Issue 398083002: Add "UninstallReason" parameter to ExtensionRegistryObserver::OnExtensionUninstalled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix header file. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 <string> 5 #include <string>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/compiler_specific.h" 9 #include "base/compiler_specific.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "content/public/browser/resource_context.h" 73 #include "content/public/browser/resource_context.h"
74 #include "content/public/browser/web_contents.h" 74 #include "content/public/browser/web_contents.h"
75 #include "content/public/browser/web_contents_observer.h" 75 #include "content/public/browser/web_contents_observer.h"
76 #include "content/public/common/frame_navigate_params.h" 76 #include "content/public/common/frame_navigate_params.h"
77 #include "content/public/common/page_transition_types.h" 77 #include "content/public/common/page_transition_types.h"
78 #include "content/public/common/renderer_preferences.h" 78 #include "content/public/common/renderer_preferences.h"
79 #include "content/public/common/url_constants.h" 79 #include "content/public/common/url_constants.h"
80 #include "content/public/test/browser_test_utils.h" 80 #include "content/public/test/browser_test_utils.h"
81 #include "content/public/test/test_navigation_observer.h" 81 #include "content/public/test/test_navigation_observer.h"
82 #include "extensions/browser/extension_system.h" 82 #include "extensions/browser/extension_system.h"
83 #include "extensions/browser/uninstall_reason.h"
83 #include "extensions/common/extension.h" 84 #include "extensions/common/extension.h"
84 #include "extensions/common/extension_set.h" 85 #include "extensions/common/extension_set.h"
85 #include "grit/chromium_strings.h" 86 #include "grit/chromium_strings.h"
86 #include "grit/generated_resources.h" 87 #include "grit/generated_resources.h"
87 #include "net/dns/mock_host_resolver.h" 88 #include "net/dns/mock_host_resolver.h"
88 #include "net/test/spawned_test_server/spawned_test_server.h" 89 #include "net/test/spawned_test_server/spawned_test_server.h"
89 #include "ui/base/l10n/l10n_util.h" 90 #include "ui/base/l10n/l10n_util.h"
90 91
91 #if defined(OS_MACOSX) 92 #if defined(OS_MACOSX)
92 #include "base/mac/mac_util.h" 93 #include "base/mac/mac_util.h"
(...skipping 1207 matching lines...) Expand 10 before | Expand all | Expand 10 after
1300 TabStripModel::ADD_NONE); 1301 TabStripModel::ADD_NONE);
1301 model->SetTabPinned(0, true); 1302 model->SetTabPinned(0, true);
1302 ui_test_utils::NavigateToURL(browser(), url); 1303 ui_test_utils::NavigateToURL(browser(), url);
1303 1304
1304 MockTabStripModelObserver observer; 1305 MockTabStripModelObserver observer;
1305 model->AddObserver(&observer); 1306 model->AddObserver(&observer);
1306 1307
1307 // Uninstall the extension and make sure TabClosing is sent. 1308 // Uninstall the extension and make sure TabClosing is sent.
1308 ExtensionService* service = extensions::ExtensionSystem::Get( 1309 ExtensionService* service = extensions::ExtensionSystem::Get(
1309 browser()->profile())->extension_service(); 1310 browser()->profile())->extension_service();
1310 service->UninstallExtension(GetExtension()->id(), 1311 service->UninstallExtension(
1311 ExtensionService::UNINSTALL_REASON_FOR_TESTING, 1312 GetExtension()->id(), extensions::UNINSTALL_REASON_FOR_TESTING, NULL);
1312 NULL);
1313 EXPECT_EQ(1, observer.closing_count()); 1313 EXPECT_EQ(1, observer.closing_count());
1314 1314
1315 model->RemoveObserver(&observer); 1315 model->RemoveObserver(&observer);
1316 1316
1317 // There should only be one tab now. 1317 // There should only be one tab now.
1318 ASSERT_EQ(1, browser()->tab_strip_model()->count()); 1318 ASSERT_EQ(1, browser()->tab_strip_model()->count());
1319 } 1319 }
1320 1320
1321 #if !defined(OS_MACOSX) 1321 #if !defined(OS_MACOSX)
1322 // Open with --app-id=<id>, and see that an app window opens. 1322 // Open with --app-id=<id>, and see that an app window opens.
(...skipping 1381 matching lines...) Expand 10 before | Expand all | Expand 10 after
2704 #endif 2704 #endif
2705 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2705 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2706 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2706 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2707 gfx::Size exp_final_size(initial_wcv_size); 2707 gfx::Size exp_final_size(initial_wcv_size);
2708 exp_final_size.Enlarge(wcv_resize_insets.width(), 2708 exp_final_size.Enlarge(wcv_resize_insets.width(),
2709 wcv_resize_insets.height() + height_inset); 2709 wcv_resize_insets.height() + height_inset);
2710 EXPECT_EQ(exp_final_size, 2710 EXPECT_EQ(exp_final_size,
2711 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2711 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2712 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2712 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2713 } 2713 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698