| 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 "base/path_service.h" |
| 6 #include "chrome/common/chrome_paths.h" |
| 5 #include "chrome/common/extensions/api/extension_action/action_info.h" | 7 #include "chrome/common/extensions/api/extension_action/action_info.h" |
| 6 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 8 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" |
| 7 #include "extensions/common/constants.h" | 9 #include "extensions/common/constants.h" |
| 8 #include "extensions/common/error_utils.h" | 10 #include "extensions/common/error_utils.h" |
| 9 #include "extensions/common/extension.h" | 11 #include "extensions/common/extension.h" |
| 10 #include "extensions/common/manifest_constants.h" | 12 #include "extensions/common/manifest_constants.h" |
| 11 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 12 | 14 |
| 13 namespace extensions { | 15 namespace extensions { |
| 14 | 16 |
| 15 namespace errors = manifest_errors; | 17 namespace errors = manifest_errors; |
| 16 namespace keys = manifest_keys; | 18 namespace keys = manifest_keys; |
| 17 | 19 |
| 18 class PageActionManifestTest : public ExtensionManifestTest { | 20 class PageActionManifestTest : public ChromeManifestTest { |
| 19 protected: | 21 protected: |
| 20 virtual const char* test_data_dir() OVERRIDE { | 22 virtual base::FilePath GetTestDataDir() OVERRIDE { |
| 21 return "page_action"; | 23 base::FilePath path; |
| 24 PathService::Get(chrome::DIR_TEST_DATA, &path); |
| 25 return path.AppendASCII("extensions").AppendASCII("page_action"); |
| 22 } | 26 } |
| 23 | 27 |
| 24 scoped_ptr<ActionInfo> LoadAction(const std::string& manifest_filename); | 28 scoped_ptr<ActionInfo> LoadAction(const std::string& manifest_filename); |
| 25 }; | 29 }; |
| 26 | 30 |
| 27 scoped_ptr<ActionInfo> PageActionManifestTest::LoadAction( | 31 scoped_ptr<ActionInfo> PageActionManifestTest::LoadAction( |
| 28 const std::string& manifest_filename) { | 32 const std::string& manifest_filename) { |
| 29 scoped_refptr<Extension> extension = LoadAndExpectSuccess( | 33 scoped_refptr<Extension> extension = LoadAndExpectSuccess( |
| 30 manifest_filename.c_str()); | 34 manifest_filename.c_str()); |
| 31 const ActionInfo* page_action_info = | 35 const ActionInfo* page_action_info = |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 action = LoadAction("page_action_empty_popup.json"); | 162 action = LoadAction("page_action_empty_popup.json"); |
| 159 | 163 |
| 160 ASSERT_TRUE(action); | 164 ASSERT_TRUE(action); |
| 161 EXPECT_TRUE(action->default_popup_url.is_empty()); | 165 EXPECT_TRUE(action->default_popup_url.is_empty()); |
| 162 ASSERT_STREQ( | 166 ASSERT_STREQ( |
| 163 "", | 167 "", |
| 164 action->default_popup_url.spec().c_str()); | 168 action->default_popup_url.spec().c_str()); |
| 165 } | 169 } |
| 166 | 170 |
| 167 } // namespace extensions | 171 } // namespace extensions |
| OLD | NEW |