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

Side by Side Diff: chrome/browser/spellchecker/misspelling_unittest.cc

Issue 16387014: Use a direct include of utf_string_conversions.h in chrome/browser/, part 3. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/json/json_reader.h" 5 #include "base/json/json_reader.h"
6 #include "base/utf_string_conversions.h" 6 #include "base/strings/utf_string_conversions.h"
7 #include "base/values.h" 7 #include "base/values.h"
8 #include "chrome/browser/spellchecker/misspelling.h" 8 #include "chrome/browser/spellchecker/misspelling.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
11 TEST(MisspellingTest, SerializeTest) { 11 TEST(MisspellingTest, SerializeTest) {
12 Misspelling misspelling; 12 Misspelling misspelling;
13 misspelling.context = ASCIIToUTF16("How doe sit know"); 13 misspelling.context = ASCIIToUTF16("How doe sit know");
14 misspelling.location = 4; 14 misspelling.location = 4;
15 misspelling.length = 7; 15 misspelling.length = 7;
16 misspelling.timestamp = base::Time::FromJsTime(42); 16 misspelling.timestamp = base::Time::FromJsTime(42);
17 misspelling.hash = 9001; 17 misspelling.hash = 9001;
18 misspelling.suggestions.push_back(ASCIIToUTF16("does it")); 18 misspelling.suggestions.push_back(ASCIIToUTF16("does it"));
19 19
20 scoped_ptr<base::Value> expected(base::JSONReader::Read( 20 scoped_ptr<base::Value> expected(base::JSONReader::Read(
21 "{\"originalText\": \"How doe sit know\"," 21 "{\"originalText\": \"How doe sit know\","
22 "\"misspelledStart\": 4," 22 "\"misspelledStart\": 4,"
23 "\"misspelledLength\": 7," 23 "\"misspelledLength\": 7,"
24 "\"timestamp\": \"42\"," 24 "\"timestamp\": \"42\","
25 "\"suggestionId\":\"9001\"," 25 "\"suggestionId\":\"9001\","
26 "\"suggestions\": [\"does it\"]," 26 "\"suggestions\": [\"does it\"],"
27 "\"userActions\": [{\"actionType\": \"PENDING\"}]}")); 27 "\"userActions\": [{\"actionType\": \"PENDING\"}]}"));
28 28
29 scoped_ptr<base::DictionaryValue> serialized(misspelling.Serialize()); 29 scoped_ptr<base::DictionaryValue> serialized(misspelling.Serialize());
30 EXPECT_TRUE(serialized->Equals(expected.get())); 30 EXPECT_TRUE(serialized->Equals(expected.get()));
31 } 31 }
OLDNEW
« no previous file with comments | « chrome/browser/spellchecker/feedback_sender_unittest.cc ('k') | chrome/browser/spellchecker/spellcheck_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698