Fix DevToolsBeforeUnloadTest and BrowserCloseManagerBrowserTest.

They were attempting to disable the beforeunload timeout, but the switch provided no longer worked.

BUG=705306, 418266, 700271, 700641
TEST=Linux MSan Tests goes green
CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation;master.tryserver.chromium.linux:linux_chromium_msan_rel_ng

Review-Url: https://codereview.chromium.org/2777013004
Cr-Commit-Position: refs/heads/master@{#460472}
diff --git a/chrome/browser/lifetime/browser_close_manager_browsertest.cc b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
index 9500cc2..baa05366 100644
--- a/chrome/browser/lifetime/browser_close_manager_browsertest.cc
+++ b/chrome/browser/lifetime/browser_close_manager_browsertest.cc
@@ -45,6 +45,7 @@
 #include "content/public/browser/download_item.h"
 #include "content/public/browser/download_manager.h"
 #include "content/public/browser/notification_service.h"
+#include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/render_view_host.h"
 #include "content/public/browser/render_widget_host.h"
 #include "content/public/browser/web_contents.h"
@@ -291,14 +292,12 @@
         observer.NumDownloadsSeenInState(content::DownloadItem::IN_PROGRESS));
   }
 
-  // Makes sure that hang monitor will not trigger RendererUnresponsive
-  // for that web content or browser. That must be called before close action
-  // when using |AcceptClose| or |CancelClose|, to ensure the timeout does not
-  // prevent the dialog from appearing. https://crbug.com/519646
+  // Makes sure that the beforeunload hang monitor will not trigger. That must
+  // be called before close action when using |AcceptClose| or |CancelClose|, to
+  // ensure the timeout does not prevent the dialog from appearing.
+  // https://crbug.com/519646
   void DisableHangMonitor(content::WebContents* web_contents) {
-    web_contents->GetRenderViewHost()
-        ->GetWidget()
-        ->DisableHangMonitorForTesting();
+    web_contents->GetMainFrame()->DisableBeforeUnloadHangMonitorForTesting();
   }
 
   void DisableHangMonitor(Browser* browser) {