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
3// found in the LICENSE file.
4
5#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
6#include "chrome/common/extensions/manifest_url_handler.h"
7#include "extensions/common/extension.h"
8#include "extensions/common/manifest_constants.h"
9#include "extensions/common/permissions/permissions_data.h"
10#include "testing/gtest/include/gtest/gtest.h"
11
12class DevToolsPageManifestTest : public ChromeManifestTest {
13};
14
15TEST_F(DevToolsPageManifestTest, DevToolsExtensions) {
16  LoadAndExpectError("devtools_extension_url_invalid_type.json",
17                     extensions::manifest_errors::kInvalidDevToolsPage);
18
19  scoped_refptr<extensions::Extension> extension;
20  extension = LoadAndExpectSuccess("devtools_extension.json");
21  EXPECT_EQ(extension->url().spec() + "devtools.html",
22            extensions::ManifestURL::GetDevToolsPage(extension.get()).spec());
23  EXPECT_TRUE(extension->permissions_data()->HasEffectiveAccessToAllHosts());
24}
25