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

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

Issue 15318004: Store feedback for spellcheck results from spelling service (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Move typedefs to feedback.h Created 7 years, 7 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
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 <string> 5 #include <string>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/message_loop.h" 10 #include "base/message_loop.h"
(...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 "\"suggestionId\":\"42\"," 426 "\"suggestionId\":\"42\","
427 "\"suggestions\":[\"Hello\"]," 427 "\"suggestions\":[\"Hello\"],"
428 "\"timestamp\":\"9001\"," 428 "\"timestamp\":\"9001\","
429 "\"userActions\":[{\"actionType\":\"NO_ACTION\"}]}]}}"; 429 "\"userActions\":[{\"actionType\":\"NO_ACTION\"}]}]}}";
430 scoped_ptr<base::Value> expected(base::JSONReader::Read(expected_data)); 430 scoped_ptr<base::Value> expected(base::JSONReader::Read(expected_data));
431 EXPECT_TRUE(expected->Equals(actual.get())) 431 EXPECT_TRUE(expected->Equals(actual.get()))
432 << "Expected data: " << expected_data 432 << "Expected data: " << expected_data
433 << "\nActual data: " << actual_data; 433 << "\nActual data: " << actual_data;
434 } 434 }
435 435
436 // Duplicate spellcheck results should be matched to the existing markers.
437 TEST_F(FeedbackSenderTest, MatchDupliateResultsWithExistingMarkers) {
groby-ooo-7-16 2013/05/23 19:10:50 Why a new test - was there new functionality?
please use gerrit instead 2013/05/23 19:50:47 No new functionality. I was increasing test covera
438 uint32 hash = AddPendingFeedback();
439 std::vector<SpellCheckResult> results(1, SpellCheckResult(
440 SpellCheckResult::SPELLING,
441 kMisspellingStart + 10,
442 kMisspellingLength,
443 ASCIIToUTF16("Hello")));
444 std::vector<SpellCheckMarker> markers(1, SpellCheckMarker(
445 hash, results[0].location));
446 EXPECT_EQ(static_cast<uint32>(0), results[0].hash);
447 feedback_.OnSpellcheckResults(&results, kRendererProcessId, kText, markers);
448 EXPECT_EQ(hash, results[0].hash);
449 }
450
436 } // namespace spellcheck 451 } // namespace spellcheck
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698