This source file includes following definitions.
- TEST_F
#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
#include "chrome/common/extensions/manifest_url_handler.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extensions::manifest_errors;
class URLOverridesManifestTest : public ExtensionManifestTest {
};
TEST_F(URLOverridesManifestTest, Override) {
Testcase testcases[] = {
Testcase("override_newtab_and_history.json", errors::kMultipleOverrides),
Testcase("override_invalid_page.json", errors::kInvalidChromeURLOverrides)
};
RunTestcases(testcases, arraysize(testcases),
EXPECT_TYPE_ERROR);
scoped_refptr<extensions::Extension> extension;
extension = LoadAndExpectSuccess("override_new_tab.json");
EXPECT_EQ(extension->url().spec() + "newtab.html",
extensions::URLOverrides::GetChromeURLOverrides(extension.get())
.find("newtab")->second.spec());
extension = LoadAndExpectSuccess("override_history.json");
EXPECT_EQ(extension->url().spec() + "history.html",
extensions::URLOverrides::GetChromeURLOverrides(extension.get())
.find("history")->second.spec());
}