| 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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 199 public: | 199 public: |
| 200 TabContentsTest() | 200 TabContentsTest() |
| 201 : RenderViewHostTestHarness(), | 201 : RenderViewHostTestHarness(), |
| 202 ui_thread_(ChromeThread::UI, &message_loop_) { | 202 ui_thread_(ChromeThread::UI, &message_loop_) { |
| 203 } | 203 } |
| 204 | 204 |
| 205 private: | 205 private: |
| 206 // Supply our own profile so we use the correct profile data. The test harness | 206 // Supply our own profile so we use the correct profile data. The test harness |
| 207 // is not supposed to overwrite a profile if it's already created. | 207 // is not supposed to overwrite a profile if it's already created. |
| 208 virtual void SetUp() { | 208 virtual void SetUp() { |
| 209 profile_.reset(new TabContentsTestingProfile()); | 209 TestingProfile* profile = new TestingProfile(); |
| 210 profile_.reset(profile); |
| 210 | 211 |
| 211 RenderViewHostTestHarness::SetUp(); | 212 RenderViewHostTestHarness::SetUp(); |
| 212 } | 213 } |
| 213 | 214 |
| 214 virtual void TearDown() { | 215 virtual void TearDown() { |
| 215 RenderViewHostTestHarness::TearDown(); | 216 RenderViewHostTestHarness::TearDown(); |
| 216 | 217 |
| 217 profile_.reset(NULL); | 218 profile_.reset(NULL); |
| 218 } | 219 } |
| 219 | 220 |
| (...skipping 1249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1469 | 1470 |
| 1470 // While the interstitial is showing, let's simulate the hidden page | 1471 // While the interstitial is showing, let's simulate the hidden page |
| 1471 // attempting to show a JS message. | 1472 // attempting to show a JS message. |
| 1472 IPC::Message* dummy_message = new IPC::Message; | 1473 IPC::Message* dummy_message = new IPC::Message; |
| 1473 bool did_suppress_message = false; | 1474 bool did_suppress_message = false; |
| 1474 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", | 1475 contents()->RunJavaScriptMessage(L"This is an informative message", L"OK", |
| 1475 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, | 1476 kGURL, MessageBoxFlags::kIsJavascriptAlert, dummy_message, |
| 1476 &did_suppress_message); | 1477 &did_suppress_message); |
| 1477 EXPECT_TRUE(did_suppress_message); | 1478 EXPECT_TRUE(did_suppress_message); |
| 1478 } | 1479 } |
| OLD | NEW |