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

Side by Side Diff: chrome/browser/extensions/extensions_service_unittest.cc

Issue 426014: Merge 32770 - Revert change that disallowed content scripts access to... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/249/src/
Patch Set: Created 11 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
OLDNEW
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2009 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 <algorithm> 5 #include <algorithm>
6 #include <vector> 6 #include <vector>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/json/json_reader.h" 10 #include "base/json/json_reader.h"
(...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 ValidateIntegerPref(good1, L"location", Extension::INTERNAL); 532 ValidateIntegerPref(good1, L"location", Extension::INTERNAL);
533 ValidateIntegerPref(good2, L"state", Extension::ENABLED); 533 ValidateIntegerPref(good2, L"state", Extension::ENABLED);
534 ValidateIntegerPref(good2, L"location", Extension::INTERNAL); 534 ValidateIntegerPref(good2, L"location", Extension::INTERNAL);
535 535
536 Extension* extension = loaded_[0]; 536 Extension* extension = loaded_[0];
537 const UserScriptList& scripts = extension->content_scripts(); 537 const UserScriptList& scripts = extension->content_scripts();
538 const std::vector<Extension::ToolstripInfo>& toolstrips = 538 const std::vector<Extension::ToolstripInfo>& toolstrips =
539 extension->toolstrips(); 539 extension->toolstrips();
540 ASSERT_EQ(2u, scripts.size()); 540 ASSERT_EQ(2u, scripts.size());
541 EXPECT_EQ(3u, scripts[0].url_patterns().size()); 541 EXPECT_EQ(3u, scripts[0].url_patterns().size());
542 EXPECT_EQ("file://*",
543 scripts[0].url_patterns()[0].GetAsString());
542 EXPECT_EQ("http://*.google.com/*", 544 EXPECT_EQ("http://*.google.com/*",
543 scripts[0].url_patterns()[0].GetAsString()); 545 scripts[0].url_patterns()[1].GetAsString());
544 EXPECT_EQ("https://*.google.com/*", 546 EXPECT_EQ("https://*.google.com/*",
545 scripts[0].url_patterns()[1].GetAsString());
546 EXPECT_EQ("http://localhost/*",
547 scripts[0].url_patterns()[2].GetAsString()); 547 scripts[0].url_patterns()[2].GetAsString());
548 EXPECT_EQ(2u, scripts[0].js_scripts().size()); 548 EXPECT_EQ(2u, scripts[0].js_scripts().size());
549 ExtensionResource resource00(scripts[0].js_scripts()[0].extension_root(), 549 ExtensionResource resource00(scripts[0].js_scripts()[0].extension_root(),
550 scripts[0].js_scripts()[0].relative_path()); 550 scripts[0].js_scripts()[0].relative_path());
551 FilePath expected_path(extension->path().AppendASCII("script1.js")); 551 FilePath expected_path(extension->path().AppendASCII("script1.js"));
552 ASSERT_TRUE(file_util::AbsolutePath(&expected_path)); 552 ASSERT_TRUE(file_util::AbsolutePath(&expected_path));
553 EXPECT_TRUE(resource00.ComparePathWithDefault(expected_path)); 553 EXPECT_TRUE(resource00.ComparePathWithDefault(expected_path));
554 ExtensionResource resource01(scripts[0].js_scripts()[1].extension_root(), 554 ExtensionResource resource01(scripts[0].js_scripts()[1].extension_root(),
555 scripts[0].js_scripts()[1].relative_path()); 555 scripts[0].js_scripts()[1].relative_path());
556 expected_path = extension->path().AppendASCII("script2.js"); 556 expected_path = extension->path().AppendASCII("script2.js");
(...skipping 1035 matching lines...) Expand 10 before | Expand all | Expand 10 after
1592 1592
1593 recorder.set_ready(false); 1593 recorder.set_ready(false);
1594 command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY)); 1594 command_line.reset(new CommandLine(CommandLine::ARGUMENTS_ONLY));
1595 service = new ExtensionsService(&profile, command_line.get(), 1595 service = new ExtensionsService(&profile, command_line.get(),
1596 profile.GetPrefs(), install_dir, false); 1596 profile.GetPrefs(), install_dir, false);
1597 EXPECT_FALSE(service->extensions_enabled()); 1597 EXPECT_FALSE(service->extensions_enabled());
1598 service->Init(); 1598 service->Init();
1599 loop.RunAllPending(); 1599 loop.RunAllPending();
1600 EXPECT_TRUE(recorder.ready()); 1600 EXPECT_TRUE(recorder.ready());
1601 } 1601 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_startup_unittest.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698