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

Unified Diff: ui/gfx/linux_util_unittest.cc

Issue 10316013: linux: Move linux_util.h from gfx/ to ui/base/gtk. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: LinuxUtilTest -> MenuLabelAcceleratorTest Created 8 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/linux_util.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/linux_util_unittest.cc
diff --git a/ui/gfx/linux_util_unittest.cc b/ui/gfx/linux_util_unittest.cc
deleted file mode 100644
index 781c2c0b01813ff986c96cd32f5e6e3f6d46a200..0000000000000000000000000000000000000000
--- a/ui/gfx/linux_util_unittest.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/gfx/linux_util.h"
-
-#include "base/basictypes.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace gfx {
-
-TEST(LinuxUtilTest, ConvertAcceleratorsFromWindowsStyle) {
- static const struct {
- const char* input;
- const char* output;
- } cases[] = {
- { "", "" },
- { "nothing", "nothing" },
- { "foo &bar", "foo _bar" },
- { "foo &&bar", "foo &bar" },
- { "foo &&&bar", "foo &_bar" },
- { "&foo &&bar", "_foo &bar" },
- { "&foo &bar", "_foo _bar" },
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- std::string result = ConvertAcceleratorsFromWindowsStyle(cases[i].input);
- EXPECT_EQ(cases[i].output, result);
- }
-}
-
-TEST(LinuxUtilTest, RemoveWindowsStyleAccelerators) {
- static const struct {
- const char* input;
- const char* output;
- } cases[] = {
- { "", "" },
- { "nothing", "nothing" },
- { "foo &bar", "foo bar" },
- { "foo &&bar", "foo &bar" },
- { "foo &&&bar", "foo &bar" },
- { "&foo &&bar", "foo &bar" },
- { "&foo &bar", "foo bar" },
- };
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- std::string result = RemoveWindowsStyleAccelerators(cases[i].input);
- EXPECT_EQ(cases[i].output, result);
- }
-}
-
-TEST(LinuxUtilTest, EscapeWindowsStyleAccelerators) {
- static const struct {
- const char* input;
- const char* output;
- } cases[] = {
- { "nothing", "nothing" },
- { "foo &bar", "foo &&bar" },
- { "foo &&bar", "foo &&&&bar" },
- { "foo &&&bar", "foo &&&&&&bar" },
- { "&foo bar", "&&foo bar" },
- { "&&foo bar", "&&&&foo bar" },
- { "&&&foo bar", "&&&&&&foo bar" },
- { "&foo &bar", "&&foo &&bar" },
- { "&&foo &&bar", "&&&&foo &&&&bar" },
- { "f&o&o ba&r", "f&&o&&o ba&&r" },
- { "foo_&_bar", "foo_&&_bar" },
- { "&_foo_bar_&", "&&_foo_bar_&&" },
- };
-
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(cases); ++i) {
- std::string result = EscapeWindowsStyleAccelerators(cases[i].input);
- EXPECT_EQ(cases[i].output, result);
- }
-}
-
-} // namespace gfx
« no previous file with comments | « ui/gfx/linux_util.cc ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698