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

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

Issue 2702153003: [content] Fix background color update handling in RWHVAura. (Closed)
Patch Set: Remove GetBackgroundOpaque and base impls of accessors. Created 3 years, 9 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <tuple> 9 #include <tuple>
10 10
(...skipping 869 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 std::unique_ptr<RenderWidgetHostViewBase> view; 880 std::unique_ptr<RenderWidgetHostViewBase> view;
881 #if defined(USE_AURA) 881 #if defined(USE_AURA)
882 view.reset(new RenderWidgetHostViewAura(host_.get(), false)); 882 view.reset(new RenderWidgetHostViewAura(host_.get(), false));
883 // TODO(derat): Call this on all platforms: http://crbug.com/102450. 883 // TODO(derat): Call this on all platforms: http://crbug.com/102450.
884 view->InitAsChild(NULL); 884 view->InitAsChild(NULL);
885 #elif defined(OS_ANDROID) 885 #elif defined(OS_ANDROID)
886 view.reset(new RenderWidgetHostViewAndroid(host_.get(), NULL)); 886 view.reset(new RenderWidgetHostViewAndroid(host_.get(), NULL));
887 #endif 887 #endif
888 host_->SetView(view.get()); 888 host_->SetView(view.get());
889 889
890 EXPECT_TRUE(view->GetBackgroundOpaque()); 890 EXPECT_EQ(static_cast<unsigned>(SK_AlphaOPAQUE),
891 SkColorGetA(view->background_color()));
891 view->SetBackgroundColor(SK_ColorTRANSPARENT); 892 view->SetBackgroundColor(SK_ColorTRANSPARENT);
892 EXPECT_FALSE(view->GetBackgroundOpaque()); 893 EXPECT_EQ(static_cast<unsigned>(SK_AlphaTRANSPARENT),
danakj 2017/02/28 17:52:31 You could just EXPECT_EQ(SK_ColorTRANSPARENT, view
Eric Seckler 2017/03/01 10:22:09 Done.
894 SkColorGetA(view->background_color()));
893 895
894 const IPC::Message* set_background = 896 const IPC::Message* set_background =
895 process_->sink().GetUniqueMessageMatching( 897 process_->sink().GetUniqueMessageMatching(
896 ViewMsg_SetBackgroundOpaque::ID); 898 ViewMsg_SetBackgroundOpaque::ID);
897 ASSERT_TRUE(set_background); 899 ASSERT_TRUE(set_background);
898 std::tuple<bool> sent_background; 900 std::tuple<bool> sent_background;
899 ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background); 901 ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background);
900 EXPECT_FALSE(std::get<0>(sent_background)); 902 EXPECT_FALSE(std::get<0>(sent_background));
901 903
902 host_->SetView(NULL); 904 host_->SetView(NULL);
(...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 ui::LatencyInfo()); 1745 ui::LatencyInfo());
1744 1746
1745 1747
1746 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). 1748 // Tests RWHI::ForwardWheelEventWithLatencyInfo().
1747 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); 1749 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo());
1748 1750
1749 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); 1751 ASSERT_FALSE(host_->input_router()->HasPendingEvents());
1750 } 1752 }
1751 1753
1752 } // namespace content 1754 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698