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

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

Issue 11093080: <webview>: First stab at implementing media permission request for guests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Implement first allow/deny wins, still requires preventDefault impl + now tests pass. Created 7 years, 10 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) 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 "base/utf_string_conversions.h" 5 #include "base/utf_string_conversions.h"
6 #include "chrome/browser/automation/automation_util.h" 6 #include "chrome/browser/automation/automation_util.h"
7 #include "chrome/browser/extensions/extension_test_message_listener.h" 7 #include "chrome/browser/extensions/extension_test_message_listener.h"
8 #include "chrome/browser/extensions/platform_app_browsertest_util.h" 8 #include "chrome/browser/extensions/platform_app_browsertest_util.h"
9 #include "chrome/browser/prerender/prerender_link_manager.h" 9 #include "chrome/browser/prerender/prerender_link_manager.h"
10 #include "chrome/browser/prerender/prerender_link_manager_factory.h" 10 #include "chrome/browser/prerender/prerender_link_manager_factory.h"
11 #include "chrome/browser/ui/browser.h" 11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/tabs/tab_strip_model.h" 12 #include "chrome/browser/ui/tabs/tab_strip_model.h"
13 #include "chrome/common/chrome_switches.h"
13 #include "chrome/test/base/ui_test_utils.h" 14 #include "chrome/test/base/ui_test_utils.h"
14 #include "chrome/test/base/test_launcher_utils.h" 15 #include "chrome/test/base/test_launcher_utils.h"
16 #include "chrome/test/base/ui_test_utils.h"
15 #include "content/public/browser/notification_service.h" 17 #include "content/public/browser/notification_service.h"
16 #include "content/public/browser/render_process_host.h" 18 #include "content/public/browser/render_process_host.h"
17 #include "content/public/test/browser_test_utils.h" 19 #include "content/public/test/browser_test_utils.h"
18 #include "content/public/test/fake_speech_recognition_manager.h" 20 #include "content/public/test/fake_speech_recognition_manager.h"
19 #include "ui/compositor/compositor_setup.h" 21 #include "ui/compositor/compositor_setup.h"
20 #include "ui/gl/gl_switches.h" 22 #include "ui/gl/gl_switches.h"
21 23
22 using prerender::PrerenderLinkManager; 24 using prerender::PrerenderLinkManager;
23 using prerender::PrerenderLinkManagerFactory; 25 using prerender::PrerenderLinkManagerFactory;
24 26
(...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 // Click on the guest (center of the WebContents), the guest is rendered in a 697 // Click on the guest (center of the WebContents), the guest is rendered in a
696 // way that this will trigger clicking on speech recognition input mic. 698 // way that this will trigger clicking on speech recognition input mic.
697 SimulateMouseClick(guest_web_contents, 0, WebKit::WebMouseEvent::ButtonLeft); 699 SimulateMouseClick(guest_web_contents, 0, WebKit::WebMouseEvent::ButtonLeft);
698 700
699 string16 expected_title(ASCIIToUTF16("PASSED")); 701 string16 expected_title(ASCIIToUTF16("PASSED"));
700 string16 error_title(ASCIIToUTF16("FAILED")); 702 string16 error_title(ASCIIToUTF16("FAILED"));
701 content::TitleWatcher title_watcher(guest_web_contents, expected_title); 703 content::TitleWatcher title_watcher(guest_web_contents, expected_title);
702 title_watcher.AlsoWaitForTitle(error_title); 704 title_watcher.AlsoWaitForTitle(error_title);
703 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle()); 705 EXPECT_EQ(expected_title, title_watcher.WaitAndGetTitle());
704 } 706 }
707
708 IN_PROC_BROWSER_TEST_F(WebViewTest, MediaAccessApiEmbedderHasPermission) {
709 // Requires "experimental" permission.
710 CommandLine::ForCurrentProcess()->AppendSwitch(
711 switches::kEnableExperimentalExtensionApis);
712 ASSERT_TRUE(StartTestServer()); // For serving guest pages.
713 ASSERT_TRUE(RunPlatformAppTest(
714 "platform_apps/web_view/media_access/embedder_has_permission"))
715 << message_;
716 }
717
718 IN_PROC_BROWSER_TEST_F(WebViewTest, MediaAccessApiEmbedderHasNoPermission) {
719 // Requires "experimental" permission.
720 CommandLine::ForCurrentProcess()->AppendSwitch(
721 switches::kEnableExperimentalExtensionApis);
722 ASSERT_TRUE(StartTestServer()); // For serving guest pages.
723 ASSERT_TRUE(RunPlatformAppTest(
724 "platform_apps/web_view/media_access/embedder_has_no_permission"))
725 << message_;
726 }
727
OLDNEW
« no previous file with comments | « no previous file | chrome/chrome_renderer.gypi » ('j') | chrome/renderer/resources/extensions/web_view.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698