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

Side by Side Diff: chrome/test/media_router/media_router_integration_browsertest.cc

Issue 2533073002: [Presentation API] Throw NotAllowedError instead of AbortError when user closes MR dialog (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/test/media_router/media_router_integration_browsertest.h" 5 #include "chrome/test/media_router/media_router_integration_browsertest.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after
590 browser()->tab_strip_model()->GetActiveWebContents(); 590 browser()->tab_strip_model()->GetActiveWebContents();
591 ASSERT_TRUE(web_contents); 591 ASSERT_TRUE(web_contents);
592 ExecuteJavaScriptAPI(web_contents, kWaitDeviceScript); 592 ExecuteJavaScriptAPI(web_contents, kWaitDeviceScript);
593 content::TestNavigationObserver test_navigation_observer(web_contents, 1); 593 content::TestNavigationObserver test_navigation_observer(web_contents, 1);
594 StartSession(web_contents); 594 StartSession(web_contents);
595 595
596 MediaRouterDialogControllerImpl* controller = 596 MediaRouterDialogControllerImpl* controller =
597 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); 597 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents);
598 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); 598 EXPECT_TRUE(controller->IsShowingMediaRouterDialog());
599 controller->HideMediaRouterDialog(); 599 controller->HideMediaRouterDialog();
600 CheckStartFailed(web_contents, "AbortError", "Dialog closed."); 600 CheckStartFailed(web_contents, "NotAllowedError", "Dialog closed.");
601 } 601 }
602 602
603 IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest, 603 IN_PROC_BROWSER_TEST_F(MediaRouterIntegrationBrowserTest,
604 MANUAL_Fail_StartCancelledNoSinks) { 604 MANUAL_Fail_StartCancelledNoSinks) {
605 SetTestData(FILE_PATH_LITERAL("no_sinks.json")); 605 SetTestData(FILE_PATH_LITERAL("no_sinks.json"));
606 OpenTestPage(FILE_PATH_LITERAL("basic_test.html")); 606 OpenTestPage(FILE_PATH_LITERAL("basic_test.html"));
607 content::WebContents* web_contents = 607 content::WebContents* web_contents =
608 browser()->tab_strip_model()->GetActiveWebContents(); 608 browser()->tab_strip_model()->GetActiveWebContents();
609 ASSERT_TRUE(web_contents); 609 ASSERT_TRUE(web_contents);
610 content::TestNavigationObserver test_navigation_observer(web_contents, 1); 610 content::TestNavigationObserver test_navigation_observer(web_contents, 1);
(...skipping 18 matching lines...) Expand all
629 629
630 MediaRouterDialogControllerImpl* controller = 630 MediaRouterDialogControllerImpl* controller =
631 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents); 631 MediaRouterDialogControllerImpl::GetOrCreateForWebContents(web_contents);
632 EXPECT_TRUE(controller->IsShowingMediaRouterDialog()); 632 EXPECT_TRUE(controller->IsShowingMediaRouterDialog());
633 WaitUntilSinkDiscoveredOnUI(); 633 WaitUntilSinkDiscoveredOnUI();
634 controller->HideMediaRouterDialog(); 634 controller->HideMediaRouterDialog();
635 CheckStartFailed(web_contents, "NotFoundError", "No screens found."); 635 CheckStartFailed(web_contents, "NotFoundError", "No screens found.");
636 } 636 }
637 637
638 } // namespace media_router 638 } // namespace media_router
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698