| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/message_box_flags.h" | 5 #include "app/message_box_flags.h" |
| 6 #include "base/logging.h" | 6 #include "base/logging.h" |
| 7 #include "chrome/browser/renderer_host/render_view_host.h" | 7 #include "chrome/browser/renderer_host/render_view_host.h" |
| 8 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 8 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" | 9 #include "chrome/browser/renderer_host/test/test_render_view_host.h" |
| 10 #include "chrome/browser/tab_contents/interstitial_page.h" | 10 #include "chrome/browser/tab_contents/interstitial_page.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 TEST_F(TabContentsTest, WebKitPrefs) { | 576 TEST_F(TabContentsTest, WebKitPrefs) { |
| 577 WebPreferences webkit_prefs = contents()->TestGetWebkitPrefs(); | 577 WebPreferences webkit_prefs = contents()->TestGetWebkitPrefs(); |
| 578 | 578 |
| 579 // These values have been overridden by the profile preferences. | 579 // These values have been overridden by the profile preferences. |
| 580 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding); | 580 EXPECT_EQ("UTF-8", webkit_prefs.default_encoding); |
| 581 EXPECT_EQ(20, webkit_prefs.default_font_size); | 581 EXPECT_EQ(20, webkit_prefs.default_font_size); |
| 582 EXPECT_EQ(false, webkit_prefs.text_areas_are_resizable); | 582 EXPECT_EQ(false, webkit_prefs.text_areas_are_resizable); |
| 583 EXPECT_EQ(true, webkit_prefs.uses_universal_detector); | 583 EXPECT_EQ(true, webkit_prefs.uses_universal_detector); |
| 584 | 584 |
| 585 // These should still be the default values. | 585 // These should still be the default values. |
| 586 EXPECT_EQ(L"Times New Roman", webkit_prefs.standard_font_family); | 586 #if defined(OS_MACOSX) |
| 587 const wchar_t kDefaultFont[] = L"Times"; |
| 588 #else |
| 589 const wchar_t kDefaultFont[] = L"Times New Roman"; |
| 590 #endif |
| 591 EXPECT_EQ(kDefaultFont, webkit_prefs.standard_font_family); |
| 587 EXPECT_EQ(true, webkit_prefs.javascript_enabled); | 592 EXPECT_EQ(true, webkit_prefs.javascript_enabled); |
| 588 } | 593 } |
| 589 | 594 |
| 590 //////////////////////////////////////////////////////////////////////////////// | 595 //////////////////////////////////////////////////////////////////////////////// |
| 591 // Interstitial Tests | 596 // Interstitial Tests |
| 592 //////////////////////////////////////////////////////////////////////////////// | 597 //////////////////////////////////////////////////////////////////////////////// |
| 593 | 598 |
| 594 // Test navigating to a page (with the navigation initiated from the browser, | 599 // Test navigating to a page (with the navigation initiated from the browser, |
| 595 // as when a URL is typed in the location bar) that shows an interstitial and | 600 // as when a URL is typed in the location bar) that shows an interstitial and |
| 596 // creates a new navigation entry, then hiding it without proceeding. | 601 // creates a new navigation entry, then hiding it without proceeding. |
| (...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1288 | 1293 |
| 1289 // While the interstitial is showing, let's simulate the hidden page | 1294 // While the interstitial is showing, let's simulate the hidden page |
| 1290 // attempting to show a JS message. | 1295 // attempting to show a JS message. |
| 1291 IPC::Message* dummy_message = new IPC::Message; | 1296 IPC::Message* dummy_message = new IPC::Message; |
| 1292 bool did_suppress_message = false; | 1297 bool did_suppress_message = false; |
| 1293 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", | 1298 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", |
| 1294 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, | 1299 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, |
| 1295 &did_suppress_message); | 1300 &did_suppress_message); |
| 1296 EXPECT_TRUE(did_suppress_message); | 1301 EXPECT_TRUE(did_suppress_message); |
| 1297 } | 1302 } |
| OLD | NEW |