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

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

Issue 64273008: [Windows] Finish global and non-global media keys support on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix the test case!! Created 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/extensions/active_tab_permission_granter.h" 5 #include "chrome/browser/extensions/active_tab_permission_granter.h"
6 #include "chrome/browser/extensions/browser_action_test_util.h" 6 #include "chrome/browser/extensions/browser_action_test_util.h"
7 #include "chrome/browser/extensions/extension_action.h" 7 #include "chrome/browser/extensions/extension_action.h"
8 #include "chrome/browser/extensions/extension_action_manager.h" 8 #include "chrome/browser/extensions/extension_action_manager.h"
9 #include "chrome/browser/extensions/extension_apitest.h" 9 #include "chrome/browser/extensions/extension_apitest.h"
10 #include "chrome/browser/extensions/tab_helper.h" 10 #include "chrome/browser/extensions/tab_helper.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 result = false; 254 result = false;
255 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 255 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
256 tab, 256 tab,
257 "setInterval(function() {" 257 "setInterval(function() {"
258 " if (document.body.bgColor == 'blue') {" 258 " if (document.body.bgColor == 'blue') {"
259 " window.domAutomationController.send(true)}}, 100)", 259 " window.domAutomationController.send(true)}}, 100)",
260 &result)); 260 &result));
261 ASSERT_TRUE(result); 261 ASSERT_TRUE(result);
262 } 262 }
263 263
264 #if defined(OS_WIN)
265 // Currently this feature is implemented on Windows only.
266 #define MAYBE_AllowDuplicatedMediaKeys AllowDuplicatedMediaKeys
267 #else
268 #define MAYBE_AllowDuplicatedMediaKeys DISABLED_AllowDuplicatedMediaKeys
269 #endif
270
271 // Test that media keys go to all extensions that register for them.
272 IN_PROC_BROWSER_TEST_F(CommandsApiTest, MAYBE_AllowDuplicatedMediaKeys) {
273 ResultCatcher catcher;
274 ASSERT_TRUE(RunExtensionTest("keybinding/non_global_media_keys_0"))
275 << message_;
276 ASSERT_TRUE(catcher.GetNextResult());
277 ASSERT_TRUE(RunExtensionTest("keybinding/non_global_media_keys_1"))
278 << message_;
279 ASSERT_TRUE(catcher.GetNextResult());
280
281 // Activate the Media Stop key.
282 ASSERT_TRUE(ui_test_utils::SendKeyPressSync(
283 browser(), ui::VKEY_MEDIA_STOP, false, false, false, false));
284
285 // We should get two success result.
286 ASSERT_TRUE(catcher.GetNextResult());
287 ASSERT_TRUE(catcher.GetNextResult());
288 }
289
264 } // namespace extensions 290 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698