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

Side by Side Diff: chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc

Issue 13409003: Hide ContentClient getters from embedders so that they they don't reuse content's embedder API. The… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 7 years, 8 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 | Annotate | Revision Log
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 <list> 5 #include <list>
6 #include <set> 6 #include <set>
7 7
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/stringprintf.h" 10 #include "base/stringprintf.h"
(...skipping 333 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 public: 344 public:
345 WebNavigationApiTest() {} 345 WebNavigationApiTest() {}
346 virtual ~WebNavigationApiTest() {} 346 virtual ~WebNavigationApiTest() {}
347 347
348 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE { 348 virtual void SetUpInProcessBrowserTestFixture() OVERRIDE {
349 ExtensionApiTest::SetUpInProcessBrowserTestFixture(); 349 ExtensionApiTest::SetUpInProcessBrowserTestFixture();
350 350
351 test_navigation_listener_ = new TestNavigationListener(); 351 test_navigation_listener_ = new TestNavigationListener();
352 content_browser_client_.reset( 352 content_browser_client_.reset(
353 new TestContentBrowserClient(test_navigation_listener_.get())); 353 new TestContentBrowserClient(test_navigation_listener_.get()));
354 original_content_browser_client_ = content::GetContentClient()->browser(); 354 original_content_browser_client_ = content::SetBrowserClientForTesting(
355 content::GetContentClient()->set_browser_for_testing(
356 content_browser_client_.get()); 355 content_browser_client_.get());
357 356
358 FrameNavigationState::set_allow_extension_scheme(true); 357 FrameNavigationState::set_allow_extension_scheme(true);
359 358
360 CommandLine::ForCurrentProcess()->AppendSwitch( 359 CommandLine::ForCurrentProcess()->AppendSwitch(
361 switches::kAllowLegacyExtensionManifests); 360 switches::kAllowLegacyExtensionManifests);
362 361
363 host_resolver()->AddRule("*", "127.0.0.1"); 362 host_resolver()->AddRule("*", "127.0.0.1");
364 ASSERT_TRUE(StartTestServer()); 363 ASSERT_TRUE(StartTestServer());
365 } 364 }
366 365
367 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE { 366 virtual void TearDownInProcessBrowserTestFixture() OVERRIDE {
368 ExtensionApiTest::TearDownInProcessBrowserTestFixture(); 367 ExtensionApiTest::TearDownInProcessBrowserTestFixture();
369 content::GetContentClient()->set_browser_for_testing( 368 content::SetBrowserClientForTesting(original_content_browser_client_);
370 original_content_browser_client_);
371 } 369 }
372 370
373 TestNavigationListener* test_navigation_listener() { 371 TestNavigationListener* test_navigation_listener() {
374 return test_navigation_listener_.get(); 372 return test_navigation_listener_.get();
375 } 373 }
376 374
377 private: 375 private:
378 scoped_refptr<TestNavigationListener> test_navigation_listener_; 376 scoped_refptr<TestNavigationListener> test_navigation_listener_;
379 scoped_ptr<TestContentBrowserClient> content_browser_client_; 377 scoped_ptr<TestContentBrowserClient> content_browser_client_;
380 content::ContentBrowserClient* original_content_browser_client_; 378 content::ContentBrowserClient* original_content_browser_client_;
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 url = GURL(base::StringPrintf( 716 url = GURL(base::StringPrintf(
719 "http://www.a.com:%d/" 717 "http://www.a.com:%d/"
720 "files/extensions/api_test/webnavigation/crash/b.html", 718 "files/extensions/api_test/webnavigation/crash/b.html",
721 test_server()->host_port_pair().port())); 719 test_server()->host_port_pair().port()));
722 ui_test_utils::NavigateToURL(browser(), url); 720 ui_test_utils::NavigateToURL(browser(), url);
723 721
724 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 722 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
725 } 723 }
726 724
727 } // namespace extensions 725 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/download/download_query.cc ('k') | chrome/browser/media/media_stream_capture_indicator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698