OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/string_util.h" | 7 #include "base/string_util.h" |
8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "ui/base/clipboard/clipboard.h" | 9 #include "ui/base/clipboard/clipboard.h" |
10 #include "ui/base/keycodes/keyboard_codes.h" | 10 #include "ui/base/keycodes/keyboard_codes.h" |
(...skipping 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1263 window->Show(); | 1263 window->Show(); |
1264 focus_manager_ = test_dialog_->contents_->GetFocusManager(); | 1264 focus_manager_ = test_dialog_->contents_->GetFocusManager(); |
1265 ASSERT_TRUE(focus_manager_ != NULL); | 1265 ASSERT_TRUE(focus_manager_ != NULL); |
1266 client_view_ = | 1266 client_view_ = |
1267 static_cast<views::DialogClientView*>(window->GetClientView()); | 1267 static_cast<views::DialogClientView*>(window->GetClientView()); |
1268 ok_button_ = client_view_->ok_button(); | 1268 ok_button_ = client_view_->ok_button(); |
1269 cancel_button_ = client_view_->cancel_button(); | 1269 cancel_button_ = client_view_->cancel_button(); |
1270 } | 1270 } |
1271 | 1271 |
1272 void SimularePressingEnterAndCheckDefaultButton(ButtonID button_id) { | 1272 void SimularePressingEnterAndCheckDefaultButton(ButtonID button_id) { |
1273 KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, 0, 0, 0); | 1273 KeyEvent event(ui::ET_KEY_PRESSED, ui::VKEY_RETURN, 0); |
1274 focus_manager_->OnKeyEvent(event); | 1274 focus_manager_->OnKeyEvent(event); |
1275 switch (button_id) { | 1275 switch (button_id) { |
1276 case OK: | 1276 case OK: |
1277 EXPECT_TRUE(test_dialog_->oked_); | 1277 EXPECT_TRUE(test_dialog_->oked_); |
1278 EXPECT_FALSE(test_dialog_->canceled_); | 1278 EXPECT_FALSE(test_dialog_->canceled_); |
1279 EXPECT_FALSE(test_dialog_->last_pressed_button_); | 1279 EXPECT_FALSE(test_dialog_->last_pressed_button_); |
1280 break; | 1280 break; |
1281 case CANCEL: | 1281 case CANCEL: |
1282 EXPECT_FALSE(test_dialog_->oked_); | 1282 EXPECT_FALSE(test_dialog_->oked_); |
1283 EXPECT_TRUE(test_dialog_->canceled_); | 1283 EXPECT_TRUE(test_dialog_->canceled_); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1507 #endif | 1507 #endif |
1508 } | 1508 } |
1509 | 1509 |
1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { | 1510 TEST_F(ViewTest, ChangeNativeViewHierarchyChangeHierarchy) { |
1511 // TODO(georgey): Fix the test for Linux | 1511 // TODO(georgey): Fix the test for Linux |
1512 #if defined(OS_WIN) | 1512 #if defined(OS_WIN) |
1513 TestChangeNativeViewHierarchy test(this); | 1513 TestChangeNativeViewHierarchy test(this); |
1514 test.CheckChangingHierarhy(); | 1514 test.CheckChangingHierarhy(); |
1515 #endif | 1515 #endif |
1516 } | 1516 } |
OLD | NEW |