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 "base/basictypes.h" | 5 #include "base/basictypes.h" |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/callback.h" | 7 #include "base/callback.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2487 frame()->OnNavigate(late_nav_params); | 2487 frame()->OnNavigate(late_nav_params); |
2488 ProcessPendingMessages(); | 2488 ProcessPendingMessages(); |
2489 base::Time after_navigation = | 2489 base::Time after_navigation = |
2490 base::Time::Now() + base::TimeDelta::FromDays(1); | 2490 base::Time::Now() + base::TimeDelta::FromDays(1); |
2491 | 2491 |
2492 base::Time late_nav_reported_start = | 2492 base::Time late_nav_reported_start = |
2493 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart()); | 2493 base::Time::FromDoubleT(GetMainFrame()->performance().navigationStart()); |
2494 EXPECT_LE(late_nav_reported_start, after_navigation); | 2494 EXPECT_LE(late_nav_reported_start, after_navigation); |
2495 } | 2495 } |
2496 | 2496 |
| 2497 class RenderViewImplInitialSizeTest : public RenderViewImplTest { |
| 2498 public: |
| 2499 RenderViewImplInitialSizeTest() |
| 2500 : RenderViewImplTest(), initial_size_(200, 100) {} |
| 2501 |
| 2502 protected: |
| 2503 virtual scoped_ptr<ViewMsg_Resize_Params> InitialSizeParams() override { |
| 2504 scoped_ptr<ViewMsg_Resize_Params> initial_size_params( |
| 2505 new ViewMsg_Resize_Params()); |
| 2506 initial_size_params->new_size = initial_size_; |
| 2507 return initial_size_params.Pass(); |
| 2508 } |
| 2509 |
| 2510 gfx::Size initial_size_; |
| 2511 }; |
| 2512 |
| 2513 TEST_F(RenderViewImplInitialSizeTest, InitialSize) { |
| 2514 ASSERT_EQ(initial_size_, view_->GetSize()); |
| 2515 ASSERT_EQ(initial_size_, gfx::Size(view_->GetWebView()->size())); |
| 2516 } |
| 2517 |
2497 } // namespace content | 2518 } // namespace content |
OLD | NEW |