OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/views/validation_message_bubble_delegate.h" | 5 #include "chrome/browser/ui/views/validation_message_bubble_delegate.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 | 9 |
10 namespace { | 10 namespace { |
11 | 11 |
12 gfx::Size GetSizeForMessages(const std::string& main_text, | 12 gfx::Size GetSizeForMessages(const std::string& main_text, |
13 const std::string& sub_text) { | 13 const std::string& sub_text) { |
14 ValidationMessageBubbleDelegate delegate( | 14 ValidationMessageBubbleDelegate delegate( |
15 gfx::Rect(), UTF8ToUTF16(main_text), UTF8ToUTF16(sub_text), NULL); | 15 gfx::Rect(), UTF8ToUTF16(main_text), UTF8ToUTF16(sub_text), NULL); |
16 return delegate.GetPreferredSize(); | 16 return delegate.GetPreferredSize(); |
17 } | 17 } |
(...skipping 24 matching lines...) Expand all Loading... |
42 " tempor incididunt ut labore et dolore magna aliqua."); | 42 " tempor incididunt ut labore et dolore magna aliqua."); |
43 EXPECT_GT(short_main_long_sub_size.width(), | 43 EXPECT_GT(short_main_long_sub_size.width(), |
44 short_main_medium_sub_size.width()); | 44 short_main_medium_sub_size.width()); |
45 EXPECT_GE(ValidationMessageBubbleDelegate::kWindowMaxWidth, | 45 EXPECT_GE(ValidationMessageBubbleDelegate::kWindowMaxWidth, |
46 short_main_long_sub_size.width()); | 46 short_main_long_sub_size.width()); |
47 EXPECT_GT(short_main_long_sub_size.height(), | 47 EXPECT_GT(short_main_long_sub_size.height(), |
48 short_main_medium_sub_size.height()); | 48 short_main_medium_sub_size.height()); |
49 } | 49 } |
50 | 50 |
51 } | 51 } |
OLD | NEW |