OLD | NEW |
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 <map> | 5 #include <map> |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 2465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2476 | 2476 |
2477 // Scale down |v1| | 2477 // Scale down |v1| |
2478 gfx::Transform t1; | 2478 gfx::Transform t1; |
2479 t1.SetScale(0.5, 0.5); | 2479 t1.SetScale(0.5, 0.5); |
2480 v1->SetTransform(t1); | 2480 v1->SetTransform(t1); |
2481 | 2481 |
2482 // The rectangle should remain the same for |v1|. | 2482 // The rectangle should remain the same for |v1|. |
2483 EXPECT_EQ(gfx::Rect(25, 100, 40, 15), v2->ConvertRectToParent(rect)); | 2483 EXPECT_EQ(gfx::Rect(25, 100, 40, 15), v2->ConvertRectToParent(rect)); |
2484 | 2484 |
2485 // |v2| now occupies (20, 20) to (120, 70) in |widget| | 2485 // |v2| now occupies (20, 20) to (120, 70) in |widget| |
2486 // There are some rounding of floating values here. These values may change if | 2486 EXPECT_EQ(gfx::Rect(22, 60, 21, 8).ToString(), |
2487 // floating operations are improved/changed. | 2487 v2->ConvertRectToWidget(rect).ToString()); |
2488 EXPECT_EQ(gfx::Rect(22, 60, 20, 7), v2->ConvertRectToWidget(rect)); | |
2489 | 2488 |
2490 widget->CloseNow(); | 2489 widget->CloseNow(); |
2491 } | 2490 } |
2492 | 2491 |
2493 class ObserverView : public View { | 2492 class ObserverView : public View { |
2494 public: | 2493 public: |
2495 ObserverView(); | 2494 ObserverView(); |
2496 virtual ~ObserverView(); | 2495 virtual ~ObserverView(); |
2497 | 2496 |
2498 void ResetTestState(); | 2497 void ResetTestState(); |
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3387 // Set to non default value. | 3386 // Set to non default value. |
3388 v->layer()->set_scale_content(false); | 3387 v->layer()->set_scale_content(false); |
3389 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); | 3388 scoped_ptr<ui::Layer> old_layer(v->RecreateLayer()); |
3390 ui::Layer* new_layer = v->layer(); | 3389 ui::Layer* new_layer = v->layer(); |
3391 EXPECT_FALSE(new_layer->scale_content()); | 3390 EXPECT_FALSE(new_layer->scale_content()); |
3392 } | 3391 } |
3393 | 3392 |
3394 #endif // USE_AURA | 3393 #endif // USE_AURA |
3395 | 3394 |
3396 } // namespace views | 3395 } // namespace views |
OLD | NEW |