| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/renderer/manifest/manifest_parser.h" | 5 #include "content/renderer/manifest/manifest_parser.h" |
| 6 | 6 |
| 7 #include "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
| 8 #include "content/public/common/manifest.h" | 8 #include "content/public/common/manifest.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 namespace content { | 11 namespace content { |
| 12 | 12 |
| 13 class ManifestParserTest : public testing::Test { | 13 class ManifestParserTest : public testing::Test { |
| 14 protected: | 14 protected: |
| 15 ManifestParserTest() {} | 15 ManifestParserTest() {} |
| 16 virtual ~ManifestParserTest() {} | 16 ~ManifestParserTest() override {} |
| 17 | 17 |
| 18 Manifest ParseManifest(const base::StringPiece& json, | 18 Manifest ParseManifest(const base::StringPiece& json, |
| 19 const GURL& document_url = default_document_url, | 19 const GURL& document_url = default_document_url, |
| 20 const GURL& manifest_url = default_manifest_url) { | 20 const GURL& manifest_url = default_manifest_url) { |
| 21 return ManifestParser::Parse(json, document_url, manifest_url); | 21 return ManifestParser::Parse(json, document_url, manifest_url); |
| 22 } | 22 } |
| 23 | 23 |
| 24 static const GURL default_document_url; | 24 static const GURL default_document_url; |
| 25 static const GURL default_manifest_url; | 25 static const GURL default_manifest_url; |
| 26 | 26 |
| (...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 Manifest manifest = ParseManifest("{ \"gcm_sender_id\": {} }"); | 598 Manifest manifest = ParseManifest("{ \"gcm_sender_id\": {} }"); |
| 599 EXPECT_TRUE(manifest.gcm_sender_id.is_null()); | 599 EXPECT_TRUE(manifest.gcm_sender_id.is_null()); |
| 600 } | 600 } |
| 601 { | 601 { |
| 602 Manifest manifest = ParseManifest("{ \"gcm_sender_id\": 42 }"); | 602 Manifest manifest = ParseManifest("{ \"gcm_sender_id\": 42 }"); |
| 603 EXPECT_TRUE(manifest.gcm_sender_id.is_null()); | 603 EXPECT_TRUE(manifest.gcm_sender_id.is_null()); |
| 604 } | 604 } |
| 605 } | 605 } |
| 606 | 606 |
| 607 } // namespace content | 607 } // namespace content |
| OLD | NEW |