| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/pref_service.h" | 7 #include "chrome/browser/pref_service.h" |
| 8 #include "chrome/browser/pref_value_store.h" | 8 #include "chrome/browser/pref_value_store.h" |
| 9 #include "chrome/browser/renderer_host/render_view_host.h" | 9 #include "chrome/browser/renderer_host/render_view_host.h" |
| 10 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 10 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 params->searchable_form_encoding = std::string(); | 36 params->searchable_form_encoding = std::string(); |
| 37 params->password_form = PasswordForm(); | 37 params->password_form = PasswordForm(); |
| 38 params->security_info = std::string(); | 38 params->security_info = std::string(); |
| 39 params->gesture = NavigationGestureUser; | 39 params->gesture = NavigationGestureUser; |
| 40 params->is_post = false; | 40 params->is_post = false; |
| 41 } | 41 } |
| 42 | 42 |
| 43 // Subclass the TestingProfile so that it can return certain services we need. | 43 // Subclass the TestingProfile so that it can return certain services we need. |
| 44 class TabContentsTestingProfile : public TestingProfile { | 44 class TabContentsTestingProfile : public TestingProfile { |
| 45 public: | 45 public: |
| 46 TabContentsTestingProfile() : TestingProfile() { } | 46 TabContentsTestingProfile() : TestingProfile() { |
| 47 CreateBookmarkModel(false); |
| 48 } |
| 47 | 49 |
| 48 virtual PrefService* GetPrefs() { | 50 virtual PrefService* GetPrefs() { |
| 49 if (!prefs_.get()) { | 51 if (!prefs_.get()) { |
| 50 FilePath source_path; | 52 FilePath source_path; |
| 51 PathService::Get(chrome::DIR_TEST_DATA, &source_path); | 53 PathService::Get(chrome::DIR_TEST_DATA, &source_path); |
| 52 source_path = source_path.AppendASCII("profiles") | 54 source_path = source_path.AppendASCII("profiles") |
| 53 .AppendASCII("chrome_prefs").AppendASCII("Preferences"); | 55 .AppendASCII("chrome_prefs").AppendASCII("Preferences"); |
| 54 | 56 |
| 55 // Create a preference service that only contains user defined | 57 // Create a preference service that only contains user defined |
| 56 // preference values. | 58 // preference values. |
| (...skipping 1410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1467 | 1469 |
| 1468 // While the interstitial is showing, let's simulate the hidden page | 1470 // While the interstitial is showing, let's simulate the hidden page |
| 1469 // attempting to show a JS message. | 1471 // attempting to show a JS message. |
| 1470 IPC::Message* dummy_message = new IPC::Message; | 1472 IPC::Message* dummy_message = new IPC::Message; |
| 1471 bool did_suppress_message = false; | 1473 bool did_suppress_message = false; |
| 1472 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", | 1474 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", |
| 1473 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, | 1475 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, |
| 1474 &did_suppress_message); | 1476 &did_suppress_message); |
| 1475 EXPECT_TRUE(did_suppress_message); | 1477 EXPECT_TRUE(did_suppress_message); |
| 1476 } | 1478 } |
| OLD | NEW |