Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: ui/views/widget/widget_interactive_uitest.cc

Issue 2049493004: Remove use of deprecated MessageLoop methods in ui. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h"
9 #include "base/macros.h" 10 #include "base/macros.h"
10 #include "base/path_service.h" 11 #include "base/path_service.h"
11 #include "base/run_loop.h" 12 #include "base/run_loop.h"
13 #include "base/single_thread_task_runner.h"
12 #include "base/strings/stringprintf.h" 14 #include "base/strings/stringprintf.h"
13 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "base/threading/thread_task_runner_handle.h"
14 #include "build/build_config.h" 17 #include "build/build_config.h"
15 #include "ui/base/ime/input_method.h" 18 #include "ui/base/ime/input_method.h"
16 #include "ui/base/ime/text_input_client.h" 19 #include "ui/base/ime/text_input_client.h"
17 #include "ui/base/resource/resource_bundle.h" 20 #include "ui/base/resource/resource_bundle.h"
18 #include "ui/base/ui_base_paths.h" 21 #include "ui/base/ui_base_paths.h"
19 #include "ui/base/ui_base_switches.h" 22 #include "ui/base/ui_base_switches.h"
20 #include "ui/events/event_processor.h" 23 #include "ui/events/event_processor.h"
21 #include "ui/events/event_utils.h" 24 #include "ui/events/event_utils.h"
22 #include "ui/events/test/event_generator.h" 25 #include "ui/events/test/event_generator.h"
23 #include "ui/gfx/native_widget_types.h" 26 #include "ui/gfx/native_widget_types.h"
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 467
465 View* container = new NestedLoopCaptureView(second); 468 View* container = new NestedLoopCaptureView(second);
466 first->SetContentsView(container); 469 first->SetContentsView(container);
467 470
468 second->SetContentsView(new ExitLoopOnRelease()); 471 second->SetContentsView(new ExitLoopOnRelease());
469 472
470 first->SetSize(gfx::Size(100, 100)); 473 first->SetSize(gfx::Size(100, 100));
471 first->Show(); 474 first->Show();
472 475
473 gfx::Point location(20, 20); 476 gfx::Point location(20, 20);
474 base::MessageLoop::current()->PostTask( 477 base::ThreadTaskRunnerHandle::Get()->PostTask(
475 FROM_HERE, base::Bind(&Widget::OnMouseEvent, base::Unretained(second), 478 FROM_HERE, base::Bind(&Widget::OnMouseEvent, base::Unretained(second),
476 base::Owned(new ui::MouseEvent( 479 base::Owned(new ui::MouseEvent(
477 ui::ET_MOUSE_RELEASED, location, location, 480 ui::ET_MOUSE_RELEASED, location, location,
478 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 481 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
479 ui::EF_LEFT_MOUSE_BUTTON)))); 482 ui::EF_LEFT_MOUSE_BUTTON))));
480 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, location, location, 483 ui::MouseEvent press(ui::ET_MOUSE_PRESSED, location, location,
481 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON, 484 ui::EventTimeForNow(), ui::EF_LEFT_MOUSE_BUTTON,
482 ui::EF_LEFT_MOUSE_BUTTON); 485 ui::EF_LEFT_MOUSE_BUTTON);
483 first->OnMouseEvent(&press); 486 first->OnMouseEvent(&press);
484 EXPECT_FALSE(first->HasCapture()); 487 EXPECT_FALSE(first->HasCapture());
(...skipping 1303 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 1791
1789 ui::KeyEvent key_event2(key_event); 1792 ui::KeyEvent key_event2(key_event);
1790 widget->OnKeyEvent(&key_event2); 1793 widget->OnKeyEvent(&key_event2);
1791 EXPECT_FALSE(key_event2.stopped_propagation()); 1794 EXPECT_FALSE(key_event2.stopped_propagation());
1792 1795
1793 widget->CloseNow(); 1796 widget->CloseNow();
1794 } 1797 }
1795 1798
1796 } // namespace test 1799 } // namespace test
1797 } // namespace views 1800 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.cc ('k') | ui/views/win/hwnd_message_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698