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

Side by Side Diff: chromecast/browser/test/chromecast_browser_test_helper_default.cc

Issue 1972433002: [Chromecast] Handle device scale factor correctly (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compile error Created 4 years, 7 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
« no previous file with comments | « chromecast/browser/service/cast_service_simple.cc ('k') | chromecast/graphics/cast_screen.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "chromecast/browser/test/chromecast_browser_test_helper.h" 5 #include "chromecast/browser/test/chromecast_browser_test_helper.h"
6 6
7 #include "base/memory/ptr_util.h" 7 #include "base/memory/ptr_util.h"
8 #include "chromecast/browser/cast_browser_context.h" 8 #include "chromecast/browser/cast_browser_context.h"
9 #include "chromecast/browser/cast_browser_process.h" 9 #include "chromecast/browser/cast_browser_process.h"
10 #include "chromecast/browser/cast_content_window.h" 10 #include "chromecast/browser/cast_content_window.h"
11 #include "content/public/browser/web_contents.h" 11 #include "content/public/browser/web_contents.h"
12 #include "content/public/test/browser_test_utils.h" 12 #include "content/public/test/browser_test_utils.h"
13 #include "content/public/test/test_navigation_observer.h" 13 #include "content/public/test/test_navigation_observer.h"
14 14
15 namespace chromecast { 15 namespace chromecast {
16 namespace shell { 16 namespace shell {
17 namespace { 17 namespace {
18 18
19 class DefaultHelper : public ChromecastBrowserTestHelper { 19 class DefaultHelper : public ChromecastBrowserTestHelper {
20 public: 20 public:
21 ~DefaultHelper() override {} 21 ~DefaultHelper() override {}
22 22
23 content::WebContents* NavigateToURL(const GURL& url) override { 23 content::WebContents* NavigateToURL(const GURL& url) override {
24 window_.reset(new CastContentWindow); 24 window_.reset(new CastContentWindow);
25 gfx::Size initial_size(1280, 720);
26 25
27 web_contents_ = window_->CreateWebContents( 26 web_contents_ = window_->CreateWebContents(
28 initial_size, CastBrowserProcess::GetInstance()->browser_context()); 27 CastBrowserProcess::GetInstance()->browser_context());
29 window_->CreateWindowTree(initial_size, web_contents_.get()); 28 window_->CreateWindowTree(web_contents_.get());
30 29
31 content::WaitForLoadStop(web_contents_.get()); 30 content::WaitForLoadStop(web_contents_.get());
32 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1); 31 content::TestNavigationObserver same_tab_observer(web_contents_.get(), 1);
33 content::NavigationController::LoadURLParams params(url); 32 content::NavigationController::LoadURLParams params(url);
34 params.transition_type = ui::PageTransitionFromInt( 33 params.transition_type = ui::PageTransitionFromInt(
35 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR); 34 ui::PAGE_TRANSITION_TYPED | ui::PAGE_TRANSITION_FROM_ADDRESS_BAR);
36 web_contents_->GetController().LoadURLWithParams(params); 35 web_contents_->GetController().LoadURLWithParams(params);
37 same_tab_observer.Wait(); 36 same_tab_observer.Wait();
38 37
39 return web_contents_.get(); 38 return web_contents_.get();
40 } 39 }
41 40
42 private: 41 private:
43 std::unique_ptr<CastContentWindow> window_; 42 std::unique_ptr<CastContentWindow> window_;
44 std::unique_ptr<content::WebContents> web_contents_; 43 std::unique_ptr<content::WebContents> web_contents_;
45 }; 44 };
46 45
47 } // namespace 46 } // namespace
48 47
49 std::unique_ptr<ChromecastBrowserTestHelper> 48 std::unique_ptr<ChromecastBrowserTestHelper>
50 ChromecastBrowserTestHelper::Create() { 49 ChromecastBrowserTestHelper::Create() {
51 return base::WrapUnique(new DefaultHelper()); 50 return base::WrapUnique(new DefaultHelper());
52 } 51 }
53 52
54 } // namespace shell 53 } // namespace shell
55 } // namespace chromecast 54 } // namespace chromecast
OLDNEW
« no previous file with comments | « chromecast/browser/service/cast_service_simple.cc ('k') | chromecast/graphics/cast_screen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698