OLD | NEW |
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 Loading... |
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(¶ms, 0, entry_id, true, kGURL, | 424 InitNavigateParams(¶ms, 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(¶ms); | 427 contents()->GetMainFrame()->SendNavigateWithParams(¶ms); |
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 Loading... |
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 |
OLD | NEW |