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

Side by Side Diff: chrome/browser/ui/gtk/gtk_util_unittest.cc

Issue 7712001: WindowOpenDisposition should not be exposed in base and ui modules. (1) Gdk refactoring (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: minor fix. Created 9 years, 3 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
« no previous file with comments | « chrome/browser/ui/gtk/gtk_util.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "gtk_util.h"
6
7 #include "base/stringprintf.h"
8 #include "ui/base/events.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 static const guint states[] = {
12 GDK_LOCK_MASK,
13 GDK_CONTROL_MASK,
14 GDK_SHIFT_MASK,
15 GDK_MOD1_MASK,
16 GDK_BUTTON1_MASK,
17 GDK_BUTTON2_MASK,
18 GDK_BUTTON3_MASK
19 };
20
21 static const int flags[] = {
22 ui::EF_CAPS_LOCK_DOWN,
23 ui::EF_CONTROL_DOWN,
24 ui::EF_SHIFT_DOWN,
25 ui::EF_ALT_DOWN,
26 ui::EF_LEFT_BUTTON_DOWN,
27 ui::EF_MIDDLE_BUTTON_DOWN,
28 ui::EF_RIGHT_BUTTON_DOWN
29 };
30
31 TEST(GTKUtilTest, TestEventFlagsFromGdkState) {
32 ASSERT_EQ(arraysize(states), arraysize(flags));
33
34 const int size = arraysize(states);
35 for (int i = 0; i < size; ++i) {
36 SCOPED_TRACE(base::StringPrintf(
37 "Checking EventFlagsFromGdkState: i = %d", i));
38 EXPECT_EQ(flags[i], event_utils::EventFlagsFromGdkState(states[i]));
39 }
40
41 for (int i = 0; i < size; ++i) {
42 for (int j = i + 1; j < size; ++j) {
43 SCOPED_TRACE(base::StringPrintf(
44 "Checking EventFlagsFromGdkState: i = %d, j = %d", i, j));
45 EXPECT_EQ(flags[i] | flags[j],
46 event_utils::EventFlagsFromGdkState(states[i] | states[j]));
47 }
48 }
49 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/gtk/gtk_util.cc ('k') | chrome/browser/ui/gtk/menu_gtk.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698