summaryrefslogtreecommitdiff
path: root/chromium/chrome/common/extensions/manifest_handlers/exclude_matches_manifest_unittest.cc
blob: f3dbc6d1cc07de6616e7e6aa65c8c8ef4f4a643d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "base/stl_util.h"
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
#include "extensions/common/extension.h"
#include "testing/gtest/include/gtest/gtest.h"

namespace extensions {

class ExcludeMatchesManifestTest : public ChromeManifestTest {
};

TEST_F(ExcludeMatchesManifestTest, ExcludeMatchPatterns) {
  Testcase testcases[] = {
    Testcase("exclude_matches.json"),
    Testcase("exclude_matches_empty.json")
  };
  RunTestcases(testcases, base::size(testcases), EXPECT_TYPE_SUCCESS);

  Testcase testcases2[] = {
    Testcase("exclude_matches_not_list.json",
             "Invalid value for 'content_scripts[0].exclude_matches'."),
    Testcase("exclude_matches_invalid_host.json",
             "Invalid value for 'content_scripts[0].exclude_matches[0]': "
                 "Invalid host wildcard.")
  };
  RunTestcases(testcases2, base::size(testcases2), EXPECT_TYPE_ERROR);
}

}  // namespace extensions