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

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: rebase: employ same mechanism in RWHVMac. Created 3 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
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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 std::unique_ptr<RenderWidgetHostViewBase> view; 945 std::unique_ptr<RenderWidgetHostViewBase> view;
946 #if defined(USE_AURA) 946 #if defined(USE_AURA)
947 view.reset(new RenderWidgetHostViewAura(host_.get(), false)); 947 view.reset(new RenderWidgetHostViewAura(host_.get(), false));
948 // TODO(derat): Call this on all platforms: http://crbug.com/102450. 948 // TODO(derat): Call this on all platforms: http://crbug.com/102450.
949 view->InitAsChild(NULL); 949 view->InitAsChild(NULL);
950 #elif defined(OS_ANDROID) 950 #elif defined(OS_ANDROID)
951 view.reset(new RenderWidgetHostViewAndroid(host_.get(), NULL)); 951 view.reset(new RenderWidgetHostViewAndroid(host_.get(), NULL));
952 #endif 952 #endif
953 host_->SetView(view.get()); 953 host_->SetView(view.get());
954 954
955 EXPECT_TRUE(view->GetBackgroundOpaque()); 955 EXPECT_NE(static_cast<unsigned>(SK_ColorTRANSPARENT),
956 view->background_color());
956 view->SetBackgroundColor(SK_ColorTRANSPARENT); 957 view->SetBackgroundColor(SK_ColorTRANSPARENT);
957 EXPECT_FALSE(view->GetBackgroundOpaque()); 958 EXPECT_EQ(static_cast<unsigned>(SK_ColorTRANSPARENT),
959 view->background_color());
958 960
959 const IPC::Message* set_background = 961 const IPC::Message* set_background =
960 process_->sink().GetUniqueMessageMatching( 962 process_->sink().GetUniqueMessageMatching(
961 ViewMsg_SetBackgroundOpaque::ID); 963 ViewMsg_SetBackgroundOpaque::ID);
962 ASSERT_TRUE(set_background); 964 ASSERT_TRUE(set_background);
963 std::tuple<bool> sent_background; 965 std::tuple<bool> sent_background;
964 ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background); 966 ViewMsg_SetBackgroundOpaque::Read(set_background, &sent_background);
965 EXPECT_FALSE(std::get<0>(sent_background)); 967 EXPECT_FALSE(std::get<0>(sent_background));
966 968
967 host_->SetView(NULL); 969 host_->SetView(NULL);
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after
2189 EXPECT_EQ(0u, host_->processed_frame_messages_count()); 2191 EXPECT_EQ(0u, host_->processed_frame_messages_count());
2190 2192
2191 frame = MakeCompositorFrame(1.f, frame_size); 2193 frame = MakeCompositorFrame(1.f, frame_size);
2192 frame.metadata.frame_token = frame_token3; 2194 frame.metadata.frame_token = frame_token3;
2193 host_->SubmitCompositorFrame(local_surface_id, std::move(frame)); 2195 host_->SubmitCompositorFrame(local_surface_id, std::move(frame));
2194 EXPECT_EQ(0u, host_->queued_messages_.size()); 2196 EXPECT_EQ(0u, host_->queued_messages_.size());
2195 EXPECT_EQ(1u, host_->processed_frame_messages_count()); 2197 EXPECT_EQ(1u, host_->processed_frame_messages_count());
2196 } 2198 }
2197 2199
2198 } // namespace content 2200 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698