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

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, 4 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
(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 #include "ui/base/events.h"
7 #include "chrome/test/base/testing_browser_process_test.h"
8 #include "chrome/test/base/testing_profile.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 typedef TestingBrowserProcessTest GTKUtilTest;
32
33 TEST(GTKUtilTest, TestEventFlagsFromGdkState) {
34 const int size = sizeof(states) / sizeof(states[0]);
Paweł Hajdan Jr. 2011/08/24 17:15:01 How about using arraysize or ARRAYSIZE_UNSAFE from
shinyak (Google) 2011/08/25 05:54:10 Done. used arraysize() instead.
35 for (int i = 0; i < size; ++i) {
Paweł Hajdan Jr. 2011/08/24 17:15:01 It would be nice to add SCOPED_TRACE here and belo
shinyak (Google) 2011/08/25 05:54:10 Done.
36 EXPECT_EQ(flags[i], event_utils::EventFlagsFromGdkState(states[i]));
37 }
38
39 for (int i = 0; i < size; ++i) {
40 for (int j = i + 1; j < size; ++j) {
41 EXPECT_EQ(flags[i] | flags[j],
42 event_utils::EventFlagsFromGdkState(states[i] | states[j]));
43 }
44 }
45 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698