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

Side by Side Diff: chrome/browser/ui/panels/panel_browsertest.cc

Issue 11591006: Track input latency with UMA stats (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added per event type histograms Created 7 years, 11 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 | Annotate | Revision Log
OLDNEW
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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/utf_string_conversions.h"
7 #include "chrome/app/chrome_command_ids.h" 7 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/devtools/devtools_window.h" 8 #include "chrome/browser/devtools/devtools_window.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/net/url_request_mock_util.h" 10 #include "chrome/browser/net/url_request_mock_util.h"
(...skipping 23 matching lines...) Expand all
34 #include "chrome/test/base/ui_test_utils.h" 34 #include "chrome/test/base/ui_test_utils.h"
35 #include "content/public/browser/native_web_keyboard_event.h" 35 #include "content/public/browser/native_web_keyboard_event.h"
36 #include "content/public/browser/notification_service.h" 36 #include "content/public/browser/notification_service.h"
37 #include "content/public/browser/web_contents.h" 37 #include "content/public/browser/web_contents.h"
38 #include "content/public/common/url_constants.h" 38 #include "content/public/common/url_constants.h"
39 #include "content/public/test/browser_test_utils.h" 39 #include "content/public/test/browser_test_utils.h"
40 #include "content/test/net/url_request_mock_http_job.h" 40 #include "content/test/net/url_request_mock_http_job.h"
41 #include "extensions/common/constants.h" 41 #include "extensions/common/constants.h"
42 #include "net/base/net_util.h" 42 #include "net/base/net_util.h"
43 #include "testing/gtest/include/gtest/gtest.h" 43 #include "testing/gtest/include/gtest/gtest.h"
44 #include "ui/base/events/event_utils.h"
44 #include "ui/gfx/screen.h" 45 #include "ui/gfx/screen.h"
45 46
46 using content::WebContents; 47 using content::WebContents;
47 using extensions::Extension; 48 using extensions::Extension;
48 49
49 class PanelBrowserTest : public BasePanelBrowserTest { 50 class PanelBrowserTest : public BasePanelBrowserTest {
50 public: 51 public:
51 PanelBrowserTest() : BasePanelBrowserTest() { 52 PanelBrowserTest() : BasePanelBrowserTest() {
52 } 53 }
53 54
(...skipping 1659 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 FilePath(FILE_PATH_LITERAL("update-preferred-size.html")))); 1714 FilePath(FILE_PATH_LITERAL("update-preferred-size.html"))));
1714 params.url = url; 1715 params.url = url;
1715 Panel* panel = CreatePanelWithParams(params); 1716 Panel* panel = CreatePanelWithParams(params);
1716 EXPECT_EQ(1, panel_manager->num_panels()); 1717 EXPECT_EQ(1, panel_manager->num_panels());
1717 1718
1718 // Close the panel by acclerator. 1719 // Close the panel by acclerator.
1719 content::WindowedNotificationObserver signal( 1720 content::WindowedNotificationObserver signal(
1720 chrome::NOTIFICATION_PANEL_CLOSED, 1721 chrome::NOTIFICATION_PANEL_CLOSED,
1721 content::Source<Panel>(panel)); 1722 content::Source<Panel>(panel));
1722 #if defined(USE_AURA) 1723 #if defined(USE_AURA)
1724 double now = ui::EventTimeForNow().InSecondsF();
1723 content::NativeWebKeyboardEvent key_event( 1725 content::NativeWebKeyboardEvent key_event(
1724 ui::ET_KEY_PRESSED, 1726 ui::ET_KEY_PRESSED,
1725 false, 1727 false,
1726 ui::VKEY_W, 1728 ui::VKEY_W,
1727 ui::EF_CONTROL_DOWN, 1729 ui::EF_CONTROL_DOWN,
1728 base::Time::Now().ToDoubleT()); 1730 now);
1729 #elif defined(OS_WIN) 1731 #elif defined(OS_WIN)
1730 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 }; 1732 ::MSG key_msg = { NULL, WM_KEYDOWN, ui::VKEY_W, 0 };
1731 content::NativeWebKeyboardEvent key_event(key_msg); 1733 content::NativeWebKeyboardEvent key_event(key_msg);
1732 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey; 1734 key_event.modifiers = content::NativeWebKeyboardEvent::ControlKey;
1733 #else 1735 #else
1734 content::NativeWebKeyboardEvent key_event; 1736 content::NativeWebKeyboardEvent key_event;
1735 #endif 1737 #endif
1736 panel->HandleKeyboardEvent(key_event); 1738 panel->HandleKeyboardEvent(key_event);
1737 signal.Wait(); 1739 signal.Wait();
1738 EXPECT_EQ(0, panel_manager->num_panels()); 1740 EXPECT_EQ(0, panel_manager->num_panels());
(...skipping 14 matching lines...) Expand all
1753 #else 1755 #else
1754 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize 1756 #define MAYBE_FocusChangeEventOnMinimize FocusChangeEventOnMinimize
1755 #endif 1757 #endif
1756 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest, 1758 IN_PROC_BROWSER_TEST_F(PanelExtensionApiTest,
1757 MAYBE_FocusChangeEventOnMinimize) { 1759 MAYBE_FocusChangeEventOnMinimize) {
1758 // This is needed so the subsequently created panels can be activated. 1760 // This is needed so the subsequently created panels can be activated.
1759 // On a Mac, it transforms background-only test process into foreground one. 1761 // On a Mac, it transforms background-only test process into foreground one.
1760 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser())); 1762 ASSERT_TRUE(ui_test_utils::BringBrowserWindowToFront(browser()));
1761 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_; 1763 ASSERT_TRUE(RunExtensionTest("panels/focus_change_on_minimize")) << message_;
1762 } 1764 }
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | content/browser/renderer_host/render_widget_host_view_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698