| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "chrome/browser/autofill/autofill_xml_parser.h" | 10 #include "components/autofill/browser/autofill_xml_parser.h" |
| 11 #include "chrome/browser/autofill/field_types.h" | 11 #include "components/autofill/browser/field_types.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h" | 13 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h" |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 TEST(AutofillQueryXmlParserTest, BasicQuery) { | 17 TEST(AutofillQueryXmlParserTest, BasicQuery) { |
| 18 // An XML string representing a basic query response. | 18 // An XML string representing a basic query response. |
| 19 std::string xml = "<autofillqueryresponse>" | 19 std::string xml = "<autofillqueryresponse>" |
| 20 "<field autofilltype=\"0\" />" | 20 "<field autofilltype=\"0\" />" |
| 21 "<field autofilltype=\"1\" />" | 21 "<field autofilltype=\"1\" />" |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 358 xml = ""; | 358 xml = ""; |
| 359 parse_handler.reset(new AutofillUploadXmlParser(&positive, &negative)); | 359 parse_handler.reset(new AutofillUploadXmlParser(&positive, &negative)); |
| 360 parser.reset(new buzz::XmlParser(parse_handler.get())); | 360 parser.reset(new buzz::XmlParser(parse_handler.get())); |
| 361 parser->Parse(xml.c_str(), xml.length(), true); | 361 parser->Parse(xml.c_str(), xml.length(), true); |
| 362 EXPECT_TRUE(!parse_handler->succeeded()); | 362 EXPECT_TRUE(!parse_handler->succeeded()); |
| 363 EXPECT_DOUBLE_EQ(0, positive); | 363 EXPECT_DOUBLE_EQ(0, positive); |
| 364 EXPECT_DOUBLE_EQ(0, negative); | 364 EXPECT_DOUBLE_EQ(0, negative); |
| 365 } | 365 } |
| 366 | 366 |
| 367 } // namespace | 367 } // namespace |
| OLD | NEW |