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

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

Issue 7859014: Refactor ExtensionApiTest.WebNavigationEvents* to not rely on window.setTimeout (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 9 years, 3 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/command_line.h" 5 #include "base/command_line.h"
6 #include "chrome/app/chrome_command_ids.h" 6 #include "chrome/app/chrome_command_ids.h"
7 #include "chrome/browser/extensions/extension_apitest.h" 7 #include "chrome/browser/extensions/extension_apitest.h"
8 #include "chrome/browser/extensions/extension_service.h" 8 #include "chrome/browser/extensions/extension_service.h"
9 #include "chrome/browser/extensions/extension_webnavigation_api.h" 9 #include "chrome/browser/extensions/extension_webnavigation_api.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationFailures) { 137 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationFailures) {
138 CommandLine::ForCurrentProcess()->AppendSwitch( 138 CommandLine::ForCurrentProcess()->AppendSwitch(
139 switches::kEnableExperimentalExtensionApis); 139 switches::kEnableExperimentalExtensionApis);
140 140
141 FrameNavigationState::set_allow_extension_scheme(true); 141 FrameNavigationState::set_allow_extension_scheme(true);
142 142
143 ASSERT_TRUE( 143 ASSERT_TRUE(
144 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_; 144 RunExtensionSubtest("webnavigation", "test_failures.html")) << message_;
145 } 145 }
146 146
147 // Fails almost consistently on Mac only. http://crbug.com/94932 147 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, WebNavigationUserAction) {
148 #if defined(OS_MACOSX)
149 #define MAYBE_WebNavigationUserAction FAILS_WebNavigationUserAction
150 #else
151 #define MAYBE_WebNavigationUserAction WebNavigationUserAction
152 #endif
153
154 IN_PROC_BROWSER_TEST_F(ExtensionApiTest, MAYBE_WebNavigationUserAction) {
155 CommandLine::ForCurrentProcess()->AppendSwitch( 148 CommandLine::ForCurrentProcess()->AppendSwitch(
156 switches::kEnableExperimentalExtensionApis); 149 switches::kEnableExperimentalExtensionApis);
157 150
158 FrameNavigationState::set_allow_extension_scheme(true); 151 FrameNavigationState::set_allow_extension_scheme(true);
159 152
160 // Wait for the extension to set itself up and return control to us. 153 // Wait for the extension to set itself up and return control to us.
161 ASSERT_TRUE( 154 ASSERT_TRUE(
162 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_; 155 RunExtensionSubtest("webnavigation", "test_userAction.html")) << message_;
163 156
164 ResultCatcher catcher; 157 ResultCatcher catcher;
(...skipping 15 matching lines...) Expand all
180 ExtensionWebNavigationTabObserver::Get(tab)-> 173 ExtensionWebNavigationTabObserver::Get(tab)->
181 frame_navigation_state().GetMainFrameID(); 174 frame_navigation_state().GetMainFrameID();
182 params.link_url = extension->GetResourceURL("userAction/b.html"); 175 params.link_url = extension->GetResourceURL("userAction/b.html");
183 176
184 TestRenderViewContextMenu menu(tab, params); 177 TestRenderViewContextMenu menu(tab, params);
185 menu.Init(); 178 menu.Init();
186 menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB); 179 menu.ExecuteCommand(IDC_CONTENT_CONTEXT_OPENLINKNEWTAB);
187 180
188 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message(); 181 ASSERT_TRUE(catcher.GetNextResult()) << catcher.message();
189 } 182 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698