OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" | 5 #include "chrome/browser/ui/gtk/gtk_chrome_shrinkable_hbox.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 int x; | 191 int x; |
192 int width; | 192 int width; |
193 }; | 193 }; |
194 | 194 |
195 static void CollectChildData(GtkWidget* child, gpointer userdata) { | 195 static void CollectChildData(GtkWidget* child, gpointer userdata) { |
196 guint padding; | 196 guint padding; |
197 gtk_box_query_child_packing(GTK_BOX(gtk_widget_get_parent(child)), child, | 197 gtk_box_query_child_packing(GTK_BOX(gtk_widget_get_parent(child)), child, |
198 NULL, NULL, &padding, NULL); | 198 NULL, NULL, &padding, NULL); |
199 | 199 |
200 ChildData data; | 200 ChildData data; |
201 data.visible = GTK_WIDGET_VISIBLE(child); | 201 data.visible = gtk_widget_get_visible(child); |
202 data.padding = padding; | 202 data.padding = padding; |
203 data.x = child->allocation.x; | 203 data.x = child->allocation.x; |
204 data.width = child->allocation.width; | 204 data.width = child->allocation.width; |
205 | 205 |
206 reinterpret_cast<std::vector<ChildData>*>(userdata)->push_back(data); | 206 reinterpret_cast<std::vector<ChildData>*>(userdata)->push_back(data); |
207 } | 207 } |
208 }; | 208 }; |
209 | 209 |
210 TEST_F(GtkChromeShrinkableHBoxTest, PackStart) { | 210 TEST_F(GtkChromeShrinkableHBoxTest, PackStart) { |
211 AddChildren(true); | 211 AddChildren(true); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 SCOPED_TRACE("Test LTR"); | 245 SCOPED_TRACE("Test LTR"); |
246 gtk_widget_set_direction(box_, GTK_TEXT_DIR_LTR); | 246 gtk_widget_set_direction(box_, GTK_TEXT_DIR_LTR); |
247 EXPECT_NO_FATAL_FAILURE(Test(true)); | 247 EXPECT_NO_FATAL_FAILURE(Test(true)); |
248 } | 248 } |
249 { | 249 { |
250 SCOPED_TRACE("Test RTL"); | 250 SCOPED_TRACE("Test RTL"); |
251 gtk_widget_set_direction(box_, GTK_TEXT_DIR_RTL); | 251 gtk_widget_set_direction(box_, GTK_TEXT_DIR_RTL); |
252 EXPECT_NO_FATAL_FAILURE(Test(true)); | 252 EXPECT_NO_FATAL_FAILURE(Test(true)); |
253 } | 253 } |
254 } | 254 } |
OLD | NEW |