| 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/api/extension_action/action_info.h" | 5 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 6 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" | |
| 7 #include "chrome/common/extensions/extension.h" | 6 #include "chrome/common/extensions/extension.h" |
| 8 #include "chrome/common/extensions/extension_manifest_constants.h" | 7 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 9 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 8 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 10 #include "extensions/common/error_utils.h" | 9 #include "extensions/common/error_utils.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 11 |
| 13 namespace errors = extension_manifest_errors; | 12 namespace errors = extension_manifest_errors; |
| 14 namespace keys = extension_manifest_keys; | 13 namespace keys = extension_manifest_keys; |
| 15 | 14 |
| 16 namespace extensions { | 15 namespace extensions { |
| 17 | 16 |
| 18 class PageActionManifestTest : public ExtensionManifestTest { | 17 class PageActionManifestTest : public ExtensionManifestTest { |
| 19 protected: | 18 protected: |
| 20 virtual void SetUp() OVERRIDE { | |
| 21 ExtensionManifestTest::SetUp(); | |
| 22 (new PageActionHandler)->Register(); | |
| 23 } | |
| 24 | |
| 25 virtual const char* test_data_dir() OVERRIDE { | 19 virtual const char* test_data_dir() OVERRIDE { |
| 26 return "page_action"; | 20 return "page_action"; |
| 27 } | 21 } |
| 28 | 22 |
| 29 scoped_ptr<ActionInfo> LoadAction(const std::string& manifest_filename); | 23 scoped_ptr<ActionInfo> LoadAction(const std::string& manifest_filename); |
| 30 }; | 24 }; |
| 31 | 25 |
| 32 scoped_ptr<ActionInfo> PageActionManifestTest::LoadAction( | 26 scoped_ptr<ActionInfo> PageActionManifestTest::LoadAction( |
| 33 const std::string& manifest_filename) { | 27 const std::string& manifest_filename) { |
| 34 scoped_refptr<Extension> extension = LoadAndExpectSuccess( | 28 scoped_refptr<Extension> extension = LoadAndExpectSuccess( |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 action = LoadAction("page_action_empty_popup.json"); | 154 action = LoadAction("page_action_empty_popup.json"); |
| 161 | 155 |
| 162 ASSERT_TRUE(action); | 156 ASSERT_TRUE(action); |
| 163 EXPECT_TRUE(action->default_popup_url.is_empty()); | 157 EXPECT_TRUE(action->default_popup_url.is_empty()); |
| 164 ASSERT_STREQ( | 158 ASSERT_STREQ( |
| 165 "", | 159 "", |
| 166 action->default_popup_url.spec().c_str()); | 160 action->default_popup_url.spec().c_str()); |
| 167 } | 161 } |
| 168 | 162 |
| 169 } // namespace extensions | 163 } // namespace extensions |
| OLD | NEW |