| 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1596 if (desktop_native_widget) | 1596 if (desktop_native_widget) |
| 1597 init_params.native_widget = new DesktopNativeWidgetAura(widget); | 1597 init_params.native_widget = new DesktopNativeWidgetAura(widget); |
| 1598 #else | 1598 #else |
| 1599 DCHECK(!desktop_native_widget) | 1599 DCHECK(!desktop_native_widget) |
| 1600 << "DesktopNativeWidget does not exist on non-Aura or on ChromeOS."; | 1600 << "DesktopNativeWidget does not exist on non-Aura or on ChromeOS."; |
| 1601 #endif | 1601 #endif |
| 1602 | 1602 |
| 1603 internal::NativeWidgetPrivate* native_widget = | 1603 internal::NativeWidgetPrivate* native_widget = |
| 1604 widget->native_widget_private(); | 1604 widget->native_widget_private(); |
| 1605 | 1605 |
| 1606 string16 empty; | 1606 base::string16 empty; |
| 1607 string16 s1(UTF8ToUTF16("Title1")); | 1607 base::string16 s1(UTF8ToUTF16("Title1")); |
| 1608 string16 s2(UTF8ToUTF16("Title2")); | 1608 base::string16 s2(UTF8ToUTF16("Title2")); |
| 1609 string16 s3(UTF8ToUTF16("TitleLong")); | 1609 base::string16 s3(UTF8ToUTF16("TitleLong")); |
| 1610 | 1610 |
| 1611 // The widget starts with no title, setting empty should not change | 1611 // The widget starts with no title, setting empty should not change |
| 1612 // anything. | 1612 // anything. |
| 1613 EXPECT_FALSE(native_widget->SetWindowTitle(empty)); | 1613 EXPECT_FALSE(native_widget->SetWindowTitle(empty)); |
| 1614 // Setting the title to something non-empty should cause a change. | 1614 // Setting the title to something non-empty should cause a change. |
| 1615 EXPECT_TRUE(native_widget->SetWindowTitle(s1)); | 1615 EXPECT_TRUE(native_widget->SetWindowTitle(s1)); |
| 1616 // Setting the title to something else with the same length should cause a | 1616 // Setting the title to something else with the same length should cause a |
| 1617 // change. | 1617 // change. |
| 1618 EXPECT_TRUE(native_widget->SetWindowTitle(s2)); | 1618 EXPECT_TRUE(native_widget->SetWindowTitle(s2)); |
| 1619 // Setting the title to something else with a different length should cause | 1619 // Setting the title to something else with a different length should cause |
| (...skipping 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2223 EXPECT_EQ(activate_result, MA_ACTIVATE); | 2223 EXPECT_EQ(activate_result, MA_ACTIVATE); |
| 2224 | 2224 |
| 2225 modal_dialog_widget->CloseNow(); | 2225 modal_dialog_widget->CloseNow(); |
| 2226 top_level_widget.CloseNow(); | 2226 top_level_widget.CloseNow(); |
| 2227 } | 2227 } |
| 2228 #endif | 2228 #endif |
| 2229 #endif | 2229 #endif |
| 2230 | 2230 |
| 2231 } // namespace test | 2231 } // namespace test |
| 2232 } // namespace views | 2232 } // namespace views |
| OLD | NEW |