| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/scoped_vector.h" | 5 #include "base/scoped_vector.h" |
| 6 #include "base/version.h" | |
| 7 #include "chrome/common/extensions/update_manifest.h" | 6 #include "chrome/common/extensions/update_manifest.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 9 #include "libxml/globals.h" | 8 #include "libxml/globals.h" |
| 10 | 9 |
| 11 static const char* kValidXml = | 10 static const char* kValidXml = |
| 12 "<?xml version='1.0' encoding='UTF-8'?>" | 11 "<?xml version='1.0' encoding='UTF-8'?>" |
| 13 "<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>" | 12 "<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>" |
| 14 " <app appid='12345'>" | 13 " <app appid='12345'>" |
| 15 " <updatecheck codebase='http://example.com/extension_1.2.3.4.crx'" | 14 " <updatecheck codebase='http://example.com/extension_1.2.3.4.crx'" |
| 16 " version='1.2.3.4' prodversionmin='2.0.143.0' />" | 15 " version='1.2.3.4' prodversionmin='2.0.143.0' />" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 EXPECT_EQ(firstResult->extension_id, "12345"); | 178 EXPECT_EQ(firstResult->extension_id, "12345"); |
| 180 EXPECT_EQ(firstResult->version, ""); | 179 EXPECT_EQ(firstResult->version, ""); |
| 181 | 180 |
| 182 // Parse xml with one error and one success <app> tag. | 181 // Parse xml with one error and one success <app> tag. |
| 183 EXPECT_TRUE(parser.Parse(kTwoAppsOneError)); | 182 EXPECT_TRUE(parser.Parse(kTwoAppsOneError)); |
| 184 EXPECT_FALSE(parser.errors().empty()); | 183 EXPECT_FALSE(parser.errors().empty()); |
| 185 EXPECT_EQ(1u, parser.results().list.size()); | 184 EXPECT_EQ(1u, parser.results().list.size()); |
| 186 firstResult = &parser.results().list.at(0); | 185 firstResult = &parser.results().list.at(0); |
| 187 EXPECT_EQ(firstResult->extension_id, "bbbbbbbb"); | 186 EXPECT_EQ(firstResult->extension_id, "bbbbbbbb"); |
| 188 } | 187 } |
| OLD | NEW |