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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 1832803002: Make EnableViewSourceMode a FrameMsg (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after
409 NavigationControllerImpl& cont = 409 NavigationControllerImpl& cont =
410 static_cast<NavigationControllerImpl&>(controller()); 410 static_cast<NavigationControllerImpl&>(controller());
411 const char kUrl[] = "view-source:chrome://blah"; 411 const char kUrl[] = "view-source:chrome://blah";
412 const GURL kGURL(kUrl); 412 const GURL kGURL(kUrl);
413 413
414 process()->sink().ClearMessages(); 414 process()->sink().ClearMessages();
415 415
416 cont.LoadURL( 416 cont.LoadURL(
417 kGURL, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string()); 417 kGURL, Referrer(), ui::PAGE_TRANSITION_TYPED, std::string());
418 int entry_id = cont.GetPendingEntry()->GetUniqueID(); 418 int entry_id = cont.GetPendingEntry()->GetUniqueID();
419 rvh()->GetDelegate()->RenderViewCreated(rvh());
420 // Did we get the expected message? 419 // Did we get the expected message?
421 EXPECT_TRUE(process()->sink().GetFirstMessageMatching( 420 EXPECT_TRUE(process()->sink().GetFirstMessageMatching(
422 ViewMsg_EnableViewSourceMode::ID)); 421 FrameMsg_EnableViewSourceMode::ID));
423 422
424 FrameHostMsg_DidCommitProvisionalLoad_Params params; 423 FrameHostMsg_DidCommitProvisionalLoad_Params params;
425 InitNavigateParams(&params, 0, entry_id, true, kGURL, 424 InitNavigateParams(&params, 0, entry_id, true, kGURL,
426 ui::PAGE_TRANSITION_TYPED); 425 ui::PAGE_TRANSITION_TYPED);
427 contents()->GetMainFrame()->PrepareForCommit(); 426 contents()->GetMainFrame()->PrepareForCommit();
428 contents()->GetMainFrame()->SendNavigateWithParams(&params); 427 contents()->GetMainFrame()->SendNavigateWithParams(&params);
429 // Also check title and url. 428 // Also check title and url.
430 EXPECT_EQ(base::ASCIIToUTF16(kUrl), contents()->GetTitle()); 429 EXPECT_EQ(base::ASCIIToUTF16(kUrl), contents()->GetTitle());
431 } 430 }
432 431
(...skipping 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after
3435 // An automatic navigation. 3434 // An automatic navigation.
3436 contents()->GetMainFrame()->SendNavigateWithModificationCallback( 3435 contents()->GetMainFrame()->SendNavigateWithModificationCallback(
3437 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); 3436 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture));
3438 3437
3439 EXPECT_EQ(1u, delegate->reset_count()); 3438 EXPECT_EQ(1u, delegate->reset_count());
3440 3439
3441 contents()->SetJavaScriptDialogManagerForTesting(nullptr); 3440 contents()->SetJavaScriptDialogManagerForTesting(nullptr);
3442 } 3441 }
3443 3442
3444 } // namespace content 3443 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698