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

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

Issue 8825015: Create a LegacyExtensionBrowserTest class that lets us test extensions with (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years 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/logging.h" 5 #include "base/logging.h"
6 #include "chrome/browser/extensions/extension_apitest.h" 6 #include "chrome/browser/extensions/extension_apitest.h"
7 #include "chrome/browser/extensions/extension_service.h" 7 #include "chrome/browser/extensions/extension_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser.h" 9 #include "chrome/browser/ui/browser.h"
10 #include "chrome/browser/ui/browser_list.h" 10 #include "chrome/browser/ui/browser_list.h"
11 #include "chrome/common/chrome_switches.h"
11 #include "chrome/test/base/ui_test_utils.h" 12 #include "chrome/test/base/ui_test_utils.h"
12 #include "content/browser/tab_contents/tab_contents.h" 13 #include "content/browser/tab_contents/tab_contents.h"
13 #include "googleurl/src/gurl.h" 14 #include "googleurl/src/gurl.h"
14 #include "net/base/mock_host_resolver.h" 15 #include "net/base/mock_host_resolver.h"
15 16
16 class ExtensionIconSourceTest : public ExtensionApiTest { 17 class ExtensionIconSourceTest : public ExtensionApiTest {
18 protected:
19 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
20 ExtensionApiTest::SetUpCommandLine(command_line);
21 command_line->AppendSwitch(switches::kAllowLegacyExtensionManifests);
22 }
17 }; 23 };
18 24
19 IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoaded) { 25 IN_PROC_BROWSER_TEST_F(ExtensionIconSourceTest, IconsLoaded) {
20 FilePath basedir = test_data_dir_.AppendASCII("icons"); 26 FilePath basedir = test_data_dir_.AppendASCII("icons");
21 ASSERT_TRUE(LoadExtension(basedir.AppendASCII("extension_with_permission"))); 27 ASSERT_TRUE(LoadExtension(basedir.AppendASCII("extension_with_permission")));
22 ASSERT_TRUE(LoadExtension(basedir.AppendASCII("extension_no_permission"))); 28 ASSERT_TRUE(LoadExtension(basedir.AppendASCII("extension_no_permission")));
23 std::string result; 29 std::string result;
24 30
25 // Test that the icons are loaded and that the chrome://extension-icon 31 // Test that the icons are loaded and that the chrome://extension-icon
26 // parameters work correctly. 32 // parameters work correctly.
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 // without the management permission. 76 // without the management permission.
71 ui_test_utils::OpenURLOffTheRecord( 77 ui_test_utils::OpenURLOffTheRecord(
72 browser()->profile(), 78 browser()->profile(),
73 GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html")); 79 GURL("chrome-extension://apocjbpjpkghdepdngjlknfpmabcmlao/index.html"));
74 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString( 80 ASSERT_TRUE(ui_test_utils::ExecuteJavaScriptAndExtractString(
75 otr_browser->GetSelectedTabContents()->render_view_host(), L"", 81 otr_browser->GetSelectedTabContents()->render_view_host(), L"",
76 L"window.domAutomationController.send(document.title)", 82 L"window.domAutomationController.send(document.title)",
77 &result)); 83 &result));
78 EXPECT_EQ(result, "Not Loaded"); 84 EXPECT_EQ(result, "Not Loaded");
79 } 85 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698