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

Unified Diff: chrome/browser/ui/app_list/search/tokenized_string_unittest.cc

Issue 522683003: Move basic string operations to ui/app_list/search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: gn Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/tokenized_string_unittest.cc
diff --git a/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc b/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc
deleted file mode 100644
index d5706a144f147c57ee21c9a3eb3dcf44c8d512f8..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/app_list/search/tokenized_string_unittest.cc
+++ /dev/null
@@ -1,89 +0,0 @@
-// Copyright 2013 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 "chrome/browser/ui/app_list/search/tokenized_string.h"
-
-#include "base/strings/utf_string_conversions.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-namespace app_list {
-namespace test {
-
-namespace {
-
-base::string16 GetContent(const TokenizedString& tokenized) {
- const TokenizedString::Tokens& tokens = tokenized.tokens();
- const TokenizedString::Mappings& mappings = tokenized.mappings();
-
- base::string16 str;
- for (size_t i = 0; i < tokens.size(); ++i) {
- if (i > 0)
- str += ' ';
- str += tokens[i];
- str += base::UTF8ToUTF16(mappings[i].ToString());
- }
- return str;
-}
-
-} // namespace
-
-TEST(TokenizedStringTest, Empty) {
- base::string16 empty;
- TokenizedString tokens(empty);
- EXPECT_EQ(base::string16(), GetContent(tokens));
-}
-
-TEST(TokenizedStringTest, Basic) {
- {
- base::string16 text(base::UTF8ToUTF16("ScratchPad"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("scratch{0,7} pad{7,10}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("Chess2.0"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("chess{0,5} 2.0{5,8}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("Cut the rope"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("cut{0,3} the{4,7} rope{8,12}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("AutoCAD WS"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("auto{0,4} cad{4,7} ws{8,10}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("Great TweetDeck"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("great{0,5} tweet{6,11} deck{11,15}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("Draw-It!"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("draw{0,4} it{5,7}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("Faxing & Signing"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16("faxing{0,6} signing{9,16}"),
- GetContent(tokens));
- }
- {
- base::string16 text(base::UTF8ToUTF16("!@#$%^&*()<<<**>>>"));
- TokenizedString tokens(text);
- EXPECT_EQ(base::UTF8ToUTF16(""),
- GetContent(tokens));
- }
-}
-
-} // namespace test
-} // namespace app_list
« no previous file with comments | « chrome/browser/ui/app_list/search/tokenized_string_match_unittest.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698