Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: chrome/renderer/greasemonkey_slave_unittest.cc

Issue 10895: Add Terminate() to the Process object, have RenderProcessHost use this to avo... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/renderer/greasemonkey_slave.cc ('k') | chrome/renderer/render_process.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2008 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/logging.h" 5 #include "base/logging.h"
6 #include "chrome/renderer/greasemonkey_slave.h" 6 #include "chrome/renderer/greasemonkey_slave.h"
7 #include "googleurl/src/gurl.h" 7 #include "googleurl/src/gurl.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 class GreasemonkeySlaveTest : public testing::Test {
11 };
12
13 TEST(GreasemonkeySlaveTest, EscapeGlob) { 10 TEST(GreasemonkeySlaveTest, EscapeGlob) {
14 EXPECT_EQ("", GreasemonkeyScript::EscapeGlob("")); 11 EXPECT_EQ("", GreasemonkeyScript::EscapeGlob(""));
15 EXPECT_EQ("*", GreasemonkeyScript::EscapeGlob("*")); 12 EXPECT_EQ("*", GreasemonkeyScript::EscapeGlob("*"));
16 EXPECT_EQ("www.google.com", GreasemonkeyScript::EscapeGlob("www.google.com")); 13 EXPECT_EQ("www.google.com", GreasemonkeyScript::EscapeGlob("www.google.com"));
17 EXPECT_EQ("*google.com*", GreasemonkeyScript::EscapeGlob("*google.com*")); 14 EXPECT_EQ("*google.com*", GreasemonkeyScript::EscapeGlob("*google.com*"));
18 EXPECT_EQ("foo\\\\bar\\?hot=dog", 15 EXPECT_EQ("foo\\\\bar\\?hot=dog",
19 GreasemonkeyScript::EscapeGlob("foo\\bar?hot=dog")); 16 GreasemonkeyScript::EscapeGlob("foo\\bar?hot=dog"));
20 } 17 }
21 18
22 TEST(GreasemonkeySlaveTest, Parse1) { 19 TEST(GreasemonkeySlaveTest, Parse1) {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 "// @include *foo*\n" 62 "// @include *foo*\n"
66 "// ==/UserScript=="); // no trailing newline 63 "// ==/UserScript=="); // no trailing newline
67 64
68 GreasemonkeyScript script("foo"); 65 GreasemonkeyScript script("foo");
69 script.Parse(text); 66 script.Parse(text);
70 EXPECT_EQ(1, script.include_patterns_.size()); 67 EXPECT_EQ(1, script.include_patterns_.size());
71 EXPECT_EQ(text, script.GetBody()); 68 EXPECT_EQ(text, script.GetBody());
72 EXPECT_TRUE(script.MatchesUrl(GURL("http://foo.com/bar"))); 69 EXPECT_TRUE(script.MatchesUrl(GURL("http://foo.com/bar")));
73 EXPECT_FALSE(script.MatchesUrl(GURL("http://baz.org"))); 70 EXPECT_FALSE(script.MatchesUrl(GURL("http://baz.org")));
74 } 71 }
OLDNEW
« no previous file with comments | « chrome/renderer/greasemonkey_slave.cc ('k') | chrome/renderer/render_process.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698