Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / dom_distiller / tab_utils_browsertest.cc
index 37bd4f2..6620b6d 100644 (file)
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
 #include "chrome/common/chrome_switches.h"
-#include "chrome/common/url_constants.h"
 #include "chrome/test/base/in_process_browser_test.h"
 #include "chrome/test/base/ui_test_utils.h"
 #include "components/dom_distiller/content/web_contents_main_frame_observer.h"
 #include "components/dom_distiller/core/dom_distiller_service.h"
 #include "components/dom_distiller/core/task_tracker.h"
+#include "components/dom_distiller/core/url_constants.h"
 #include "components/dom_distiller/core/url_utils.h"
 #include "content/public/browser/render_frame_host.h"
 #include "content/public/browser/web_contents.h"
@@ -32,7 +32,7 @@ const char* kSimpleArticlePath = "/dom_distiller/simple_article.html";
 
 class DomDistillerTabUtilsBrowserTest : public InProcessBrowserTest {
  public:
-  virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE {
+  void SetUpCommandLine(CommandLine* command_line) override {
     command_line->AppendSwitch(switches::kEnableDomDistiller);
   }
 };
@@ -45,12 +45,10 @@ class WebContentsMainFrameHelper : public content::WebContentsObserver {
     content::WebContentsObserver::Observe(web_contents);
   }
 
-  virtual void DidFinishLoad(
-      int64 frame_id,
-      const GURL& validated_url,
-      bool is_main_frame,
-      content::RenderViewHost* render_view_host) OVERRIDE {
-    if (is_main_frame && validated_url.scheme() == chrome::kDomDistillerScheme)
+  void DidFinishLoad(content::RenderFrameHost* render_frame_host,
+                     const GURL& validated_url) override {
+    if (!render_frame_host->GetParent() &&
+        validated_url.scheme() == kDomDistillerScheme)
       callback_.Run();
   }
 
@@ -82,8 +80,8 @@ IN_PROC_BROWSER_TEST_F(DomDistillerTabUtilsBrowserTest, TestSwapWebContents) {
 
   // Verify the new URL is showing distilled content in a new WebContents.
   EXPECT_NE(initial_web_contents, after_web_contents);
-  EXPECT_TRUE(after_web_contents->GetLastCommittedURL().SchemeIs(
-      chrome::kDomDistillerScheme));
+  EXPECT_TRUE(
+      after_web_contents->GetLastCommittedURL().SchemeIs(kDomDistillerScheme));
   EXPECT_EQ("Test Page Title",
             base::UTF16ToUTF8(after_web_contents->GetTitle()));
 }