Chromium Code Reviews| 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 "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | |
| 6 | |
| 7 #include "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 8 #include "chrome/common/extensions/extension_manifest_constants.h" | 6 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 7 #include "chrome/common/extensions/manifest_handler.h" | |
| 8 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | |
| 9 #include "chrome/common/extensions/manifest_url_handler.h" | |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 11 |
| 12 namespace keys = extension_manifest_keys; | |
| 11 namespace errors = extension_manifest_errors; | 13 namespace errors = extension_manifest_errors; |
| 12 | 14 |
| 13 TEST_F(ExtensionManifestTest, DevToolsExtensions) { | 15 namespace { |
|
Yoyo Zhou
2013/01/03 23:11:44
By the way, I didn't notice this earlier - I don't
Joe Thomas
2013/01/04 00:34:59
I remove the namespace. I added that because I rem
| |
| 16 | |
| 17 class DevToolsPageManifestTest : public ExtensionManifestTest { | |
| 18 virtual void SetUp() OVERRIDE { | |
| 19 ExtensionManifestTest::SetUp(); | |
| 20 extensions::ManifestHandler::Register(keys::kDevToolsPage, | |
| 21 new extensions::DevToolsPageHandler); | |
| 22 } | |
| 23 }; | |
| 24 | |
| 25 TEST_F(DevToolsPageManifestTest, DevToolsExtensions) { | |
| 14 LoadAndExpectError("devtools_extension_url_invalid_type.json", | 26 LoadAndExpectError("devtools_extension_url_invalid_type.json", |
| 15 errors::kInvalidDevToolsPage); | 27 errors::kInvalidDevToolsPage); |
| 16 | 28 |
| 17 scoped_refptr<extensions::Extension> extension; | 29 scoped_refptr<extensions::Extension> extension; |
| 18 extension = LoadAndExpectSuccess("devtools_extension.json"); | 30 extension = LoadAndExpectSuccess("devtools_extension.json"); |
| 19 EXPECT_EQ(extension->url().spec() + "devtools.html", | 31 EXPECT_EQ(extension->url().spec() + "devtools.html", |
| 20 extension->devtools_url().spec()); | 32 extensions::ManifestURL::GetDevToolsPage(extension).spec()); |
| 21 EXPECT_TRUE(extension->HasEffectiveAccessToAllHosts()); | 33 EXPECT_TRUE(extension->HasEffectiveAccessToAllHosts()); |
| 22 } | 34 } |
| 35 | |
| 36 } // namespace | |
| OLD | NEW |