Update To 11.40.268.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / webui / web_dialog_web_contents_delegate_unittest.cc
index 767db59..31a4d8a 100644 (file)
@@ -8,7 +8,6 @@
 
 #include "base/logging.h"
 #include "base/memory/scoped_ptr.h"
-#include "chrome/browser/history/history_types.h"
 #include "chrome/browser/ui/browser.h"
 #include "chrome/browser/ui/browser_finder.h"
 #include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -17,6 +16,7 @@
 #include "chrome/test/base/browser_with_test_window_test.h"
 #include "chrome/test/base/test_browser_window.h"
 #include "chrome/test/base/testing_profile.h"
+#include "components/history/core/browser/history_types.h"
 #include "content/public/browser/web_contents.h"
 #include "content/public/test/web_contents_tester.h"
 #include "testing/gmock/include/gmock/gmock.h"
@@ -38,8 +38,7 @@ class TestWebContentsDelegate : public WebDialogWebContentsDelegate {
   explicit TestWebContentsDelegate(content::BrowserContext* context)
       : WebDialogWebContentsDelegate(context, new ChromeWebContentsHandler) {
   }
-  virtual ~TestWebContentsDelegate() {
-  }
+  ~TestWebContentsDelegate() override {}
 
  private:
   DISALLOW_COPY_AND_ASSIGN(TestWebContentsDelegate);
@@ -47,12 +46,12 @@ class TestWebContentsDelegate : public WebDialogWebContentsDelegate {
 
 class WebDialogWebContentsDelegateTest : public BrowserWithTestWindowTest {
  public:
-  virtual void SetUp() {
+  void SetUp() override {
     BrowserWithTestWindowTest::SetUp();
     test_web_contents_delegate_.reset(new TestWebContentsDelegate(profile()));
   }
 
-  virtual void TearDown() {
+  void TearDown() override {
     test_web_contents_delegate_.reset(NULL);
     BrowserWithTestWindowTest::TearDown();
   }
@@ -65,13 +64,14 @@ TEST_F(WebDialogWebContentsDelegateTest, DoNothingMethodsTest) {
   // None of the following calls should do anything.
   EXPECT_TRUE(test_web_contents_delegate_->IsPopupOrPanel(NULL));
   history::HistoryAddPageArgs should_add_args(
-          GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(),
-          content::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false);
-  test_web_contents_delegate_->NavigationStateChanged(NULL, 0);
+      GURL(), base::Time::Now(), 0, 0, GURL(), history::RedirectList(),
+      ui::PAGE_TRANSITION_TYPED, history::SOURCE_SYNCED, false);
+  test_web_contents_delegate_->NavigationStateChanged(
+      NULL, content::InvalidateTypes(0));
   test_web_contents_delegate_->ActivateContents(NULL);
   test_web_contents_delegate_->LoadingStateChanged(NULL, true);
   test_web_contents_delegate_->CloseContents(NULL);
-  test_web_contents_delegate_->UpdateTargetURL(NULL, 0, GURL());
+  test_web_contents_delegate_->UpdateTargetURL(NULL, GURL());
   test_web_contents_delegate_->MoveContents(NULL, gfx::Rect());
   EXPECT_EQ(0, browser()->tab_strip_model()->count());
   EXPECT_EQ(1U, chrome::GetTotalBrowserCount());
@@ -79,8 +79,12 @@ TEST_F(WebDialogWebContentsDelegateTest, DoNothingMethodsTest) {
 
 TEST_F(WebDialogWebContentsDelegateTest, OpenURLFromTabTest) {
   test_web_contents_delegate_->OpenURLFromTab(
-    NULL, OpenURLParams(GURL(content::kAboutBlankURL), Referrer(),
-    NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
+      NULL,
+      OpenURLParams(GURL(url::kAboutBlankURL),
+                    Referrer(),
+                    NEW_FOREGROUND_TAB,
+                    ui::PAGE_TRANSITION_LINK,
+                    false));
   // This should create a new foreground tab in the existing browser.
   EXPECT_EQ(1, browser()->tab_strip_model()->count());
   EXPECT_EQ(1U, chrome::GetTotalBrowserCount());
@@ -102,8 +106,12 @@ TEST_F(WebDialogWebContentsDelegateTest, DetachTest) {
   EXPECT_EQ(NULL, test_web_contents_delegate_->browser_context());
   // Now, none of the following calls should do anything.
   test_web_contents_delegate_->OpenURLFromTab(
-      NULL, OpenURLParams(GURL(content::kAboutBlankURL), Referrer(),
-      NEW_FOREGROUND_TAB, content::PAGE_TRANSITION_LINK, false));
+      NULL,
+      OpenURLParams(GURL(url::kAboutBlankURL),
+                    Referrer(),
+                    NEW_FOREGROUND_TAB,
+                    ui::PAGE_TRANSITION_LINK,
+                    false));
   test_web_contents_delegate_->AddNewContents(NULL, NULL, NEW_FOREGROUND_TAB,
                                               gfx::Rect(), false, NULL);
   EXPECT_EQ(0, browser()->tab_strip_model()->count());