summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_extent_unittest.cc
diff options
context:
space:
mode:
authorandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 15:22:20 +0000
committerandybons@chromium.org <andybons@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-19 15:22:20 +0000
commit9bf14a24e1de759fddfbbee8050d65ef2d95ef18 (patch)
tree24aa03d05b22be52366d8baf06dab96638ecf71b /chrome/common/extensions/extension_extent_unittest.cc
parente685fc4178818c026f1498461edb3f2bfeff5722 (diff)
downloadchromium_src-9bf14a24e1de759fddfbbee8050d65ef2d95ef18.zip
chromium_src-9bf14a24e1de759fddfbbee8050d65ef2d95ef18.tar.gz
chromium_src-9bf14a24e1de759fddfbbee8050d65ef2d95ef18.tar.bz2
Revert 42091 - Refactor apprelated manifest properties so that they don't
include the name 'app'. I think these will be useful for normal extensions, too. Also extract an ExtensionExtent class out of Extension. I think this will be useful for passing by value to the IO thread. Review URL: http://codereview.chromium.org/1025006 TBR=aa@chromium.org Review URL: http://codereview.chromium.org/1120005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42104 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_extent_unittest.cc')
-rw-r--r--chrome/common/extensions/extension_extent_unittest.cc57
1 files changed, 0 insertions, 57 deletions
diff --git a/chrome/common/extensions/extension_extent_unittest.cc b/chrome/common/extensions/extension_extent_unittest.cc
deleted file mode 100644
index 4e308fa..0000000
--- a/chrome/common/extensions/extension_extent_unittest.cc
+++ /dev/null
@@ -1,57 +0,0 @@
-// Copyright (c) 2010 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 "chrome/common/extensions/extension.h"
-
-#include "googleurl/src/gurl.h"
-#include "testing/gtest/include/gtest/gtest.h"
-
-TEST(ExtensionExtentTest, Empty) {
- ExtensionExtent extent;
- EXPECT_FALSE(extent.ContainsURL(GURL("http://www.foo.com/bar")));
- EXPECT_FALSE(extent.ContainsURL(GURL()));
- EXPECT_FALSE(extent.ContainsURL(GURL("invalid")));
-}
-
-TEST(ExtensionExtentTest, OriginOnly) {
- ExtensionExtent extent;
- extent.set_origin(GURL("http://www.google.com/"));
-
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foo")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foobar")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foo/bar")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/?stuff#here")));
-
- EXPECT_FALSE(extent.ContainsURL(GURL("https://www.google.com/")));
- EXPECT_FALSE(extent.ContainsURL(GURL("http://www.google.com:8080/")));
-}
-
-TEST(ExtensionExtentTest, OriginAndOnePath) {
- ExtensionExtent extent;
- extent.set_origin(GURL("http://www.google.com/"));
- extent.add_path("foo");
-
- EXPECT_FALSE(extent.ContainsURL(GURL("http://www.google.com/")));
- EXPECT_FALSE(extent.ContainsURL(GURL("http://www.google.com/fo")));
-
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foo")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/FOO")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foobar")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foo/bar")));
-}
-
-TEST(ExtensionExtentTest, OriginAndTwoPaths) {
- ExtensionExtent extent;
- extent.set_origin(GURL("http://www.google.com/"));
- extent.add_path("foo");
- extent.add_path("hot");
-
- EXPECT_FALSE(extent.ContainsURL(GURL("http://www.google.com/monkey")));
-
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foo")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/hot")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/foobar")));
- EXPECT_TRUE(extent.ContainsURL(GURL("http://www.google.com/hotdog")));
-}