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

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura_unittest.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make CompositorFrameMetadata movable Created 4 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 "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <tuple> 10 #include <tuple>
(...skipping 1567 matching lines...) Expand 10 before | Expand all | Expand 10 after
1578 view_->UpdateCursorIfOverSelf(); 1578 view_->UpdateCursorIfOverSelf();
1579 EXPECT_EQ(0, cursor_client.calls_to_set_cursor()); 1579 EXPECT_EQ(0, cursor_client.calls_to_set_cursor());
1580 1580
1581 // Cursor is below the window. 1581 // Cursor is below the window.
1582 cursor_client.reset_calls_to_set_cursor(); 1582 cursor_client.reset_calls_to_set_cursor();
1583 aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(161, 161)); 1583 aura::Env::GetInstance()->set_last_mouse_location(gfx::Point(161, 161));
1584 view_->UpdateCursorIfOverSelf(); 1584 view_->UpdateCursorIfOverSelf();
1585 EXPECT_EQ(0, cursor_client.calls_to_set_cursor()); 1585 EXPECT_EQ(0, cursor_client.calls_to_set_cursor());
1586 } 1586 }
1587 1587
1588 std::unique_ptr<cc::CompositorFrame> MakeDelegatedFrame(float scale_factor, 1588 cc::CompositorFrame MakeDelegatedFrame(float scale_factor,
1589 gfx::Size size, 1589 gfx::Size size,
1590 gfx::Rect damage) { 1590 gfx::Rect damage) {
1591 std::unique_ptr<cc::CompositorFrame> frame(new cc::CompositorFrame); 1591 cc::CompositorFrame frame;
1592 frame->metadata.device_scale_factor = scale_factor; 1592 frame.metadata.device_scale_factor = scale_factor;
1593 frame->delegated_frame_data.reset(new cc::DelegatedFrameData); 1593 frame.delegated_frame_data.reset(new cc::DelegatedFrameData);
1594 1594
1595 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create(); 1595 std::unique_ptr<cc::RenderPass> pass = cc::RenderPass::Create();
1596 pass->SetNew( 1596 pass->SetNew(
1597 cc::RenderPassId(1, 1), gfx::Rect(size), damage, gfx::Transform()); 1597 cc::RenderPassId(1, 1), gfx::Rect(size), damage, gfx::Transform());
1598 frame->delegated_frame_data->render_pass_list.push_back(std::move(pass)); 1598 frame.delegated_frame_data->render_pass_list.push_back(std::move(pass));
1599 return frame; 1599 return frame;
1600 } 1600 }
1601 1601
1602 // Resizing in fullscreen mode should send the up-to-date screen info. 1602 // Resizing in fullscreen mode should send the up-to-date screen info.
1603 // http://crbug.com/324350 1603 // http://crbug.com/324350
1604 TEST_F(RenderWidgetHostViewAuraTest, DISABLED_FullscreenResize) { 1604 TEST_F(RenderWidgetHostViewAuraTest, DISABLED_FullscreenResize) {
1605 aura::Window* root_window = aura_test_helper_->root_window(); 1605 aura::Window* root_window = aura_test_helper_->root_window();
1606 root_window->SetLayoutManager(new FullscreenLayoutManager(root_window)); 1606 root_window->SetLayoutManager(new FullscreenLayoutManager(root_window));
1607 view_->InitAsFullscreen(parent_view_); 1607 view_->InitAsFullscreen(parent_view_);
1608 view_->Show(); 1608 view_->Show();
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
1723 1723
1724 // Prevent the DelegatedFrameHost from skipping frames. 1724 // Prevent the DelegatedFrameHost from skipping frames.
1725 view_->can_create_resize_lock_ = false; 1725 view_->can_create_resize_lock_ = false;
1726 1726
1727 view_->InitAsChild(NULL); 1727 view_->InitAsChild(NULL);
1728 aura::client::ParentWindowWithContext( 1728 aura::client::ParentWindowWithContext(
1729 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(), 1729 view_->GetNativeView(), parent_view_->GetNativeView()->GetRootWindow(),
1730 gfx::Rect()); 1730 gfx::Rect());
1731 view_->SetSize(large_size); 1731 view_->SetSize(large_size);
1732 view_->Show(); 1732 view_->Show();
1733 std::unique_ptr<cc::CompositorFrame> frame = 1733 cc::CompositorFrame frame =
1734 MakeDelegatedFrame(1.f, small_size, gfx::Rect(small_size)); 1734 MakeDelegatedFrame(1.f, small_size, gfx::Rect(small_size));
1735 frame->metadata.root_background_color = SK_ColorRED; 1735 frame.metadata.root_background_color = SK_ColorRED;
1736 view_->OnSwapCompositorFrame(0, std::move(frame)); 1736 view_->OnSwapCompositorFrame(0, std::move(frame));
1737 1737
1738 ui::Layer* parent_layer = view_->GetNativeView()->layer(); 1738 ui::Layer* parent_layer = view_->GetNativeView()->layer();
1739 1739
1740 ASSERT_EQ(2u, parent_layer->children().size()); 1740 ASSERT_EQ(2u, parent_layer->children().size());
1741 EXPECT_EQ(gfx::Rect(40, 0, 60, 100), parent_layer->children()[0]->bounds()); 1741 EXPECT_EQ(gfx::Rect(40, 0, 60, 100), parent_layer->children()[0]->bounds());
1742 EXPECT_EQ(SK_ColorRED, parent_layer->children()[0]->background_color()); 1742 EXPECT_EQ(SK_ColorRED, parent_layer->children()[0]->background_color());
1743 EXPECT_EQ(gfx::Rect(0, 45, 40, 55), parent_layer->children()[1]->bounds()); 1743 EXPECT_EQ(gfx::Rect(0, 45, 40, 55), parent_layer->children()[1]->bounds());
1744 EXPECT_EQ(SK_ColorRED, parent_layer->children()[1]->background_color()); 1744 EXPECT_EQ(SK_ColorRED, parent_layer->children()[1]->background_color());
1745 1745
(...skipping 2462 matching lines...) Expand 10 before | Expand all | Expand 10 after
4208 base::Bind(&ui::TextInputClient::InsertText, 4208 base::Bind(&ui::TextInputClient::InsertText,
4209 base::Unretained(text_input_client()), base::string16()); 4209 base::Unretained(text_input_client()), base::string16());
4210 for (auto index : active_view_sequence_) { 4210 for (auto index : active_view_sequence_) {
4211 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT); 4211 ActivateViewForTextInputManager(views_[index], ui::TEXT_INPUT_TYPE_TEXT);
4212 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index], 4212 EXPECT_TRUE(!!RunAndReturnIPCSent(ime_call, processes_[index],
4213 InputMsg_ImeConfirmComposition::ID)); 4213 InputMsg_ImeConfirmComposition::ID));
4214 } 4214 }
4215 } 4215 }
4216 4216
4217 } // namespace content 4217 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698