| 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 "chrome/browser/autofill/autofill_xml_parser.h" | 9 #include "chrome/browser/autofill/autofill_xml_parser.h" |
| 9 #include "chrome/browser/autofill/field_types.h" | 10 #include "chrome/browser/autofill/field_types.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
| 11 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h" | 12 #include "third_party/libjingle/source/talk/xmllite/xmlparser.h" |
| 12 | 13 |
| 13 namespace { | 14 namespace { |
| 14 | 15 |
| 15 TEST(AutofillQueryXmlParserTest, BasicQuery) { | 16 TEST(AutofillQueryXmlParserTest, BasicQuery) { |
| 16 // An XML string representing a basic query response. | 17 // An XML string representing a basic query response. |
| 17 std::string xml = "<autofillqueryresponse>" | 18 std::string xml = "<autofillqueryresponse>" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 xml = ""; | 258 xml = ""; |
| 258 parse_handler.reset(new AutofillUploadXmlParser(&positive, &negative)); | 259 parse_handler.reset(new AutofillUploadXmlParser(&positive, &negative)); |
| 259 parser.reset(new buzz::XmlParser(parse_handler.get())); | 260 parser.reset(new buzz::XmlParser(parse_handler.get())); |
| 260 parser->Parse(xml.c_str(), xml.length(), true); | 261 parser->Parse(xml.c_str(), xml.length(), true); |
| 261 EXPECT_TRUE(!parse_handler->succeeded()); | 262 EXPECT_TRUE(!parse_handler->succeeded()); |
| 262 EXPECT_DOUBLE_EQ(0, positive); | 263 EXPECT_DOUBLE_EQ(0, positive); |
| 263 EXPECT_DOUBLE_EQ(0, negative); | 264 EXPECT_DOUBLE_EQ(0, negative); |
| 264 } | 265 } |
| 265 | 266 |
| 266 } // namespace | 267 } // namespace |
| OLD | NEW |