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

Side by Side Diff: chrome/browser/extensions/api/extension_action/browser_action_apitest.cc

Issue 2740783003: Revert "Revert of Reland: Switch WindowedNotificationObserver to use base::RunLoop. (patchset #3 id… (Closed)
Patch Set: Patch for NavigatingExtensionPopupBrowserTest.DownloadViaPost. Created 3 years, 9 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
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 <stdint.h> 5 #include <stdint.h>
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h" 8 #include "base/files/file_util.h"
9 #include "base/files/scoped_temp_dir.h" 9 #include "base/files/scoped_temp_dir.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 889 matching lines...) Expand 10 before | Expand all | Expand 10 after
900 // Verify if the popup navigation succeeded or failed as expected. 900 // Verify if the popup navigation succeeded or failed as expected.
901 if (!popup) { 901 if (!popup) {
902 // If navigation ends up in a tab, then the tab will be focused and 902 // If navigation ends up in a tab, then the tab will be focused and
903 // therefore the popup will be closed, destroying associated WebContents - 903 // therefore the popup will be closed, destroying associated WebContents -
904 // don't do any verification in this case. 904 // don't do any verification in this case.
905 ADD_FAILURE() << "Navigation should not close extension pop-up"; 905 ADD_FAILURE() << "Navigation should not close extension pop-up";
906 } else { 906 } else {
907 // If the extension popup is still opened, then wait until there is no 907 // If the extension popup is still opened, then wait until there is no
908 // load in progress, and verify whether the navigation succeeded or not. 908 // load in progress, and verify whether the navigation succeeded or not.
909 WaitForLoadStop(popup); 909 WaitForLoadStop(popup);
910
911 // TODO(https://crbug.com/695073): Find out why tests fail without it.
jam 2017/03/09 16:52:57 no one is assigned that bug, so I worry that we'll
Alexander Semashko 2017/03/09 19:47:48 I was hoping that an extensions/ owner would pick
jam 2017/03/09 20:48:46 While I do appreciate this change in making things
912 content::RunAllPendingInMessageLoop();
913
910 if (expected_navigation_status == EXPECTING_NAVIGATION_SUCCESS) { 914 if (expected_navigation_status == EXPECTING_NAVIGATION_SUCCESS) {
911 EXPECT_EQ(target_url, popup->GetLastCommittedURL()) 915 EXPECT_EQ(target_url, popup->GetLastCommittedURL())
912 << "Navigation to " << target_url 916 << "Navigation to " << target_url
913 << " should succeed in an extension pop-up"; 917 << " should succeed in an extension pop-up";
914 } else { 918 } else {
915 EXPECT_NE(target_url, popup->GetLastCommittedURL()) 919 EXPECT_NE(target_url, popup->GetLastCommittedURL())
916 << "Navigation to " << target_url 920 << "Navigation to " << target_url
917 << " should fail in an extension pop-up"; 921 << " should fail in an extension pop-up";
918 EXPECT_THAT( 922 EXPECT_THAT(
919 popup->GetLastCommittedURL(), 923 popup->GetLastCommittedURL(),
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1040 // The test verification below is applicable only to scenarios where the 1044 // The test verification below is applicable only to scenarios where the
1041 // download shelf is supported - on ChromeOS, instead of the download shelf, 1045 // download shelf is supported - on ChromeOS, instead of the download shelf,
1042 // there is a download notification in the right-bottom corner of the screen. 1046 // there is a download notification in the right-bottom corner of the screen.
1043 #if !defined(OS_CHROMEOS) 1047 #if !defined(OS_CHROMEOS)
1044 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible()); 1048 EXPECT_TRUE(browser()->window()->IsDownloadShelfVisible());
1045 #endif 1049 #endif
1046 } 1050 }
1047 1051
1048 } // namespace 1052 } // namespace
1049 } // namespace extensions 1053 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698