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

Side by Side Diff: chrome/common/extensions/user_script_unittest.cc

Issue 7347011: Update URLPatternSet to contain a std::set instead of std::vector. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix windows compile errors. Created 9 years, 5 months 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/file_path.h" 5 #include "base/file_path.h"
6 #include "base/pickle.h" 6 #include "base/pickle.h"
7 #include "chrome/common/extensions/user_script.h" 7 #include "chrome/common/extensions/user_script.h"
8 #include "googleurl/src/gurl.h" 8 #include "googleurl/src/gurl.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 10
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 201
202 EXPECT_EQ(2U, script2.css_scripts().size()); 202 EXPECT_EQ(2U, script2.css_scripts().size());
203 for (size_t i = 0; i < script2.js_scripts().size(); ++i) { 203 for (size_t i = 0; i < script2.js_scripts().size(); ++i) {
204 EXPECT_EQ(script1.css_scripts()[i].url(), script2.css_scripts()[i].url()); 204 EXPECT_EQ(script1.css_scripts()[i].url(), script2.css_scripts()[i].url());
205 } 205 }
206 206
207 ASSERT_EQ(script1.globs().size(), script2.globs().size()); 207 ASSERT_EQ(script1.globs().size(), script2.globs().size());
208 for (size_t i = 0; i < script1.globs().size(); ++i) { 208 for (size_t i = 0; i < script1.globs().size(); ++i) {
209 EXPECT_EQ(script1.globs()[i], script2.globs()[i]); 209 EXPECT_EQ(script1.globs()[i], script2.globs()[i]);
210 } 210 }
211 ASSERT_EQ(script1.url_patterns().size(), script2.url_patterns().size()); 211
212 for (size_t i = 0; i < script1.url_patterns().size(); ++i) { 212 ASSERT_EQ(script1.url_patterns(), script2.url_patterns());
213 EXPECT_EQ(script1.url_patterns()[i].GetAsString(),
214 script2.url_patterns()[i].GetAsString());
215 }
216 } 213 }
217 214
218 TEST(ExtensionUserScriptTest, Defaults) { 215 TEST(ExtensionUserScriptTest, Defaults) {
219 UserScript script; 216 UserScript script;
220 ASSERT_EQ(UserScript::DOCUMENT_IDLE, script.run_location()); 217 ASSERT_EQ(UserScript::DOCUMENT_IDLE, script.run_location());
221 } 218 }
OLDNEW
« no previous file with comments | « chrome/common/extensions/user_script.cc ('k') | chrome/renderer/extensions/extension_dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698