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

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

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. Created 6 years, 1 month 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 #include "content/public/browser/render_view_host.h" 74 #include "content/public/browser/render_view_host.h"
75 #include "content/public/browser/render_widget_host_view.h" 75 #include "content/public/browser/render_widget_host_view.h"
76 #include "content/public/browser/resource_context.h" 76 #include "content/public/browser/resource_context.h"
77 #include "content/public/browser/web_contents.h" 77 #include "content/public/browser/web_contents.h"
78 #include "content/public/browser/web_contents_observer.h" 78 #include "content/public/browser/web_contents_observer.h"
79 #include "content/public/common/frame_navigate_params.h" 79 #include "content/public/common/frame_navigate_params.h"
80 #include "content/public/common/renderer_preferences.h" 80 #include "content/public/common/renderer_preferences.h"
81 #include "content/public/common/url_constants.h" 81 #include "content/public/common/url_constants.h"
82 #include "content/public/test/browser_test_utils.h" 82 #include "content/public/test/browser_test_utils.h"
83 #include "content/public/test/test_navigation_observer.h" 83 #include "content/public/test/test_navigation_observer.h"
84 #include "extensions/browser/extension_registry.h"
84 #include "extensions/browser/extension_system.h" 85 #include "extensions/browser/extension_system.h"
85 #include "extensions/browser/uninstall_reason.h" 86 #include "extensions/browser/uninstall_reason.h"
86 #include "extensions/common/extension.h" 87 #include "extensions/common/extension.h"
87 #include "extensions/common/extension_set.h" 88 #include "extensions/common/extension_set.h"
88 #include "net/dns/mock_host_resolver.h" 89 #include "net/dns/mock_host_resolver.h"
89 #include "net/test/spawned_test_server/spawned_test_server.h" 90 #include "net/test/spawned_test_server/spawned_test_server.h"
90 #include "ui/base/l10n/l10n_util.h" 91 #include "ui/base/l10n/l10n_util.h"
91 #include "ui/base/page_transition_types.h" 92 #include "ui/base/page_transition_types.h"
92 93
93 #if defined(OS_MACOSX) 94 #if defined(OS_MACOSX)
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 328
328 return page_title; 329 return page_title;
329 #else 330 #else
330 // Do we need to use the above code on POSIX as well? 331 // Do we need to use the above code on POSIX as well?
331 return page_title; 332 return page_title;
332 #endif 333 #endif
333 } 334 }
334 335
335 // Returns the app extension aptly named "App Test". 336 // Returns the app extension aptly named "App Test".
336 const Extension* GetExtension() { 337 const Extension* GetExtension() {
337 const extensions::ExtensionSet* extensions = 338 extensions::ExtensionRegistry* registry =
338 extensions::ExtensionSystem::Get( 339 extensions::ExtensionRegistry::Get(browser()->profile());
339 browser()->profile())->extension_service()->extensions(); 340 for (const scoped_refptr<const extensions::Extension>& extension :
340 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); 341 registry->enabled_extensions()) {
341 it != extensions->end(); ++it) { 342 if (extension->name() == "App Test")
342 if ((*it)->name() == "App Test") 343 return extension.get();
343 return it->get();
344 } 344 }
345 NOTREACHED(); 345 NOTREACHED();
346 return NULL; 346 return NULL;
347 } 347 }
348 }; 348 };
349 349
350 // Launch the app on a page with no title, check that the app title was set 350 // Launch the app on a page with no title, check that the app title was set
351 // correctly. 351 // correctly.
352 IN_PROC_BROWSER_TEST_F(BrowserTest, NoTitle) { 352 IN_PROC_BROWSER_TEST_F(BrowserTest, NoTitle) {
353 #if defined(OS_WIN) && defined(USE_ASH) 353 #if defined(OS_WIN) && defined(USE_ASH)
(...skipping 2295 matching lines...) Expand 10 before | Expand all | Expand 10 after
2649 #endif 2649 #endif
2650 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); 2650 EXPECT_EQ(exp_commit_size, rwhv_commit_size2);
2651 EXPECT_EQ(exp_commit_size, wcv_commit_size2); 2651 EXPECT_EQ(exp_commit_size, wcv_commit_size2);
2652 gfx::Size exp_final_size(initial_wcv_size); 2652 gfx::Size exp_final_size(initial_wcv_size);
2653 exp_final_size.Enlarge(wcv_resize_insets.width(), 2653 exp_final_size.Enlarge(wcv_resize_insets.width(),
2654 wcv_resize_insets.height() + height_inset); 2654 wcv_resize_insets.height() + height_inset);
2655 EXPECT_EQ(exp_final_size, 2655 EXPECT_EQ(exp_final_size,
2656 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); 2656 web_contents->GetRenderWidgetHostView()->GetViewBounds().size());
2657 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size()); 2657 EXPECT_EQ(exp_final_size, web_contents->GetContainerBounds().size());
2658 } 2658 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698