| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 #include "content/public/browser/web_contents.h" | 68 #include "content/public/browser/web_contents.h" |
| 69 #include "content/public/browser/web_contents_observer.h" | 69 #include "content/public/browser/web_contents_observer.h" |
| 70 #include "content/public/browser/web_contents_view.h" | 70 #include "content/public/browser/web_contents_view.h" |
| 71 #include "content/public/common/frame_navigate_params.h" | 71 #include "content/public/common/frame_navigate_params.h" |
| 72 #include "content/public/common/page_transition_types.h" | 72 #include "content/public/common/page_transition_types.h" |
| 73 #include "content/public/common/renderer_preferences.h" | 73 #include "content/public/common/renderer_preferences.h" |
| 74 #include "content/public/common/url_constants.h" | 74 #include "content/public/common/url_constants.h" |
| 75 #include "content/public/test/browser_test_utils.h" | 75 #include "content/public/test/browser_test_utils.h" |
| 76 #include "content/public/test/test_navigation_observer.h" | 76 #include "content/public/test/test_navigation_observer.h" |
| 77 #include "extensions/common/extension.h" | 77 #include "extensions/common/extension.h" |
| 78 #include "extensions/common/extension_set.h" |
| 78 #include "grit/chromium_strings.h" | 79 #include "grit/chromium_strings.h" |
| 79 #include "grit/generated_resources.h" | 80 #include "grit/generated_resources.h" |
| 80 #include "net/dns/mock_host_resolver.h" | 81 #include "net/dns/mock_host_resolver.h" |
| 81 #include "net/test/spawned_test_server/spawned_test_server.h" | 82 #include "net/test/spawned_test_server/spawned_test_server.h" |
| 82 #include "ui/base/l10n/l10n_util.h" | 83 #include "ui/base/l10n/l10n_util.h" |
| 83 | 84 |
| 84 #if defined(OS_MACOSX) | 85 #if defined(OS_MACOSX) |
| 85 #include "base/mac/mac_util.h" | 86 #include "base/mac/mac_util.h" |
| 86 #include "base/mac/scoped_nsautorelease_pool.h" | 87 #include "base/mac/scoped_nsautorelease_pool.h" |
| 87 #include "chrome/browser/ui/cocoa/run_loop_testing.h" | 88 #include "chrome/browser/ui/cocoa/run_loop_testing.h" |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 345 |
| 345 return page_title; | 346 return page_title; |
| 346 #else | 347 #else |
| 347 // Do we need to use the above code on POSIX as well? | 348 // Do we need to use the above code on POSIX as well? |
| 348 return page_title; | 349 return page_title; |
| 349 #endif | 350 #endif |
| 350 } | 351 } |
| 351 | 352 |
| 352 // Returns the app extension aptly named "App Test". | 353 // Returns the app extension aptly named "App Test". |
| 353 const Extension* GetExtension() { | 354 const Extension* GetExtension() { |
| 354 const ExtensionSet* extensions = extensions::ExtensionSystem::Get( | 355 const extensions::ExtensionSet* extensions = |
| 355 browser()->profile())->extension_service()->extensions(); | 356 extensions::ExtensionSystem::Get( |
| 356 for (ExtensionSet::const_iterator it = extensions->begin(); | 357 browser()->profile())->extension_service()->extensions(); |
| 358 for (extensions::ExtensionSet::const_iterator it = extensions->begin(); |
| 357 it != extensions->end(); ++it) { | 359 it != extensions->end(); ++it) { |
| 358 if ((*it)->name() == "App Test") | 360 if ((*it)->name() == "App Test") |
| 359 return it->get(); | 361 return it->get(); |
| 360 } | 362 } |
| 361 NOTREACHED(); | 363 NOTREACHED(); |
| 362 return NULL; | 364 return NULL; |
| 363 } | 365 } |
| 364 }; | 366 }; |
| 365 | 367 |
| 366 // Launch the app on a page with no title, check that the app title was set | 368 // Launch the app on a page with no title, check that the app title was set |
| (...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2552 exp_commit_size.Enlarge(wcv_resize_insets.width(), | 2554 exp_commit_size.Enlarge(wcv_resize_insets.width(), |
| 2553 wcv_resize_insets.height() + height_inset); | 2555 wcv_resize_insets.height() + height_inset); |
| 2554 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); | 2556 EXPECT_EQ(exp_commit_size, rwhv_commit_size2); |
| 2555 EXPECT_EQ(exp_commit_size, wcv_commit_size2); | 2557 EXPECT_EQ(exp_commit_size, wcv_commit_size2); |
| 2556 // Sizes of RenderWidgetHostView and WebContentsView before and after | 2558 // Sizes of RenderWidgetHostView and WebContentsView before and after |
| 2557 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. | 2559 // WebContentsDelegate::DidNavigateMainFramePostCommit should be the same. |
| 2558 EXPECT_EQ(rwhv_commit_size2, | 2560 EXPECT_EQ(rwhv_commit_size2, |
| 2559 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); | 2561 web_contents->GetRenderWidgetHostView()->GetViewBounds().size()); |
| 2560 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); | 2562 EXPECT_EQ(wcv_commit_size2, web_contents->GetView()->GetContainerSize()); |
| 2561 } | 2563 } |
| OLD | NEW |