OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
11 #include "base/prefs/pref_service.h" | 11 #include "base/prefs/pref_service.h" |
12 #include "base/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
13 #include "base/strings/utf_string_conversions.h" | 13 #include "base/strings/utf_string_conversions.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "chrome/browser/spellchecker/spelling_service_client.h" | 15 #include "chrome/browser/spellchecker/spelling_service_client.h" |
16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
17 #include "chrome/common/spellcheck_result.h" | 17 #include "chrome/common/spellcheck_result.h" |
18 #include "chrome/test/base/testing_profile.h" | 18 #include "chrome/test/base/testing_profile.h" |
19 #include "net/base/load_flags.h" | 19 #include "net/base/load_flags.h" |
20 #include "net/url_request/test_url_fetcher_factory.h" | 20 #include "net/url_request/test_url_fetcher_factory.h" |
21 #include "testing/gtest/include/gtest/gtest.h" | 21 #include "testing/gtest/include/gtest/gtest.h" |
22 | 22 |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); | 383 EXPECT_FALSE(client_.IsAvailable(&profile_, kSpellcheck)); |
384 } | 384 } |
385 } | 385 } |
386 | 386 |
387 // Verify that an error in JSON response from spelling service will result in | 387 // Verify that an error in JSON response from spelling service will result in |
388 // ParseResponse returning false. | 388 // ParseResponse returning false. |
389 TEST_F(SpellingServiceClientTest, ResponseErrorTest) { | 389 TEST_F(SpellingServiceClientTest, ResponseErrorTest) { |
390 EXPECT_TRUE(client_.ParseResponseSuccess("{\"result\": {}}")); | 390 EXPECT_TRUE(client_.ParseResponseSuccess("{\"result\": {}}")); |
391 EXPECT_FALSE(client_.ParseResponseSuccess("{\"error\": {}}")); | 391 EXPECT_FALSE(client_.ParseResponseSuccess("{\"error\": {}}")); |
392 } | 392 } |
OLD | NEW |