OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/win_util.h" | 6 #include "base/win_util.h" |
7 #include "chrome/common/l10n_util.h" | 7 #include "chrome/common/l10n_util.h" |
8 #include "chrome/test/automation/tab_proxy.h" | 8 #include "chrome/test/automation/tab_proxy.h" |
9 #include "chrome/test/automation/browser_proxy.h" | 9 #include "chrome/test/automation/browser_proxy.h" |
10 #include "chrome/test/ui/ui_test.h" | 10 #include "chrome/test/ui/ui_test.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 | 100 |
101 protected: | 101 protected: |
102 wstring url_prefix_; | 102 wstring url_prefix_; |
103 scoped_ptr<BrowserProxy> window_; | 103 scoped_ptr<BrowserProxy> window_; |
104 scoped_ptr<TabProxy> tab_; | 104 scoped_ptr<TabProxy> tab_; |
105 }; | 105 }; |
106 | 106 |
107 } // namespace | 107 } // namespace |
108 | 108 |
109 TEST_F(SessionHistoryTest, BasicBackForward) { | 109 TEST_F(SessionHistoryTest, BasicBackForward) { |
110 TestServer server(kDocRoot); | 110 scoped_refptr<HTTPTestServer> server = |
| 111 HTTPTestServer::CreateServer(kDocRoot); |
| 112 ASSERT_TRUE(NULL != server.get()); |
111 | 113 |
112 // about:blank should be loaded first. | 114 // about:blank should be loaded first. |
113 ASSERT_FALSE(tab_->GoBack()); | 115 ASSERT_FALSE(tab_->GoBack()); |
114 EXPECT_EQ(L"", GetTabTitle()); | 116 EXPECT_EQ(L"", GetTabTitle()); |
115 | 117 |
116 ASSERT_TRUE(tab_->NavigateToURL( | 118 ASSERT_TRUE(tab_->NavigateToURL( |
117 server.TestServerPage("files/session_history/bot1.html"))); | 119 server->TestServerPage("files/session_history/bot1.html"))); |
118 EXPECT_EQ(L"bot1", GetTabTitle()); | 120 EXPECT_EQ(L"bot1", GetTabTitle()); |
119 | 121 |
120 ASSERT_TRUE(tab_->NavigateToURL( | 122 ASSERT_TRUE(tab_->NavigateToURL( |
121 server.TestServerPage("files/session_history/bot2.html"))); | 123 server->TestServerPage("files/session_history/bot2.html"))); |
122 EXPECT_EQ(L"bot2", GetTabTitle()); | 124 EXPECT_EQ(L"bot2", GetTabTitle()); |
123 | 125 |
124 ASSERT_TRUE(tab_->NavigateToURL( | 126 ASSERT_TRUE(tab_->NavigateToURL( |
125 server.TestServerPage("files/session_history/bot3.html"))); | 127 server->TestServerPage("files/session_history/bot3.html"))); |
126 EXPECT_EQ(L"bot3", GetTabTitle()); | 128 EXPECT_EQ(L"bot3", GetTabTitle()); |
127 | 129 |
128 // history is [blank, bot1, bot2, *bot3] | 130 // history is [blank, bot1, bot2, *bot3] |
129 | 131 |
130 ASSERT_TRUE(tab_->GoBack()); | 132 ASSERT_TRUE(tab_->GoBack()); |
131 EXPECT_EQ(L"bot2", GetTabTitle()); | 133 EXPECT_EQ(L"bot2", GetTabTitle()); |
132 | 134 |
133 ASSERT_TRUE(tab_->GoBack()); | 135 ASSERT_TRUE(tab_->GoBack()); |
134 EXPECT_EQ(L"bot1", GetTabTitle()); | 136 EXPECT_EQ(L"bot1", GetTabTitle()); |
135 | 137 |
136 ASSERT_TRUE(tab_->GoForward()); | 138 ASSERT_TRUE(tab_->GoForward()); |
137 EXPECT_EQ(L"bot2", GetTabTitle()); | 139 EXPECT_EQ(L"bot2", GetTabTitle()); |
138 | 140 |
139 ASSERT_TRUE(tab_->GoBack()); | 141 ASSERT_TRUE(tab_->GoBack()); |
140 EXPECT_EQ(L"bot1", GetTabTitle()); | 142 EXPECT_EQ(L"bot1", GetTabTitle()); |
141 | 143 |
142 ASSERT_TRUE(tab_->NavigateToURL( | 144 ASSERT_TRUE(tab_->NavigateToURL( |
143 server.TestServerPage("files/session_history/bot3.html"))); | 145 server->TestServerPage("files/session_history/bot3.html"))); |
144 EXPECT_EQ(L"bot3", GetTabTitle()); | 146 EXPECT_EQ(L"bot3", GetTabTitle()); |
145 | 147 |
146 // history is [blank, bot1, *bot3] | 148 // history is [blank, bot1, *bot3] |
147 | 149 |
148 ASSERT_FALSE(tab_->GoForward()); | 150 ASSERT_FALSE(tab_->GoForward()); |
149 EXPECT_EQ(L"bot3", GetTabTitle()); | 151 EXPECT_EQ(L"bot3", GetTabTitle()); |
150 | 152 |
151 ASSERT_TRUE(tab_->GoBack()); | 153 ASSERT_TRUE(tab_->GoBack()); |
152 EXPECT_EQ(L"bot1", GetTabTitle()); | 154 EXPECT_EQ(L"bot1", GetTabTitle()); |
153 | 155 |
(...skipping 10 matching lines...) Expand all Loading... |
164 EXPECT_EQ(L"bot3", GetTabTitle()); | 166 EXPECT_EQ(L"bot3", GetTabTitle()); |
165 } | 167 } |
166 | 168 |
167 // Test that back/forward works when navigating in subframes. | 169 // Test that back/forward works when navigating in subframes. |
168 TEST_F(SessionHistoryTest, FrameBackForward) { | 170 TEST_F(SessionHistoryTest, FrameBackForward) { |
169 // Bug: http://b/1175763, skip this test on Windows 2000 until | 171 // Bug: http://b/1175763, skip this test on Windows 2000 until |
170 // flakiness is investigated and fixed. | 172 // flakiness is investigated and fixed. |
171 if (win_util::GetWinVersion() <= win_util::WINVERSION_2000) | 173 if (win_util::GetWinVersion() <= win_util::WINVERSION_2000) |
172 return; | 174 return; |
173 | 175 |
174 TestServer server(kDocRoot); | 176 scoped_refptr<HTTPTestServer> server = |
| 177 HTTPTestServer::CreateServer(kDocRoot); |
| 178 ASSERT_TRUE(NULL != server.get()); |
175 | 179 |
176 // about:blank should be loaded first. | 180 // about:blank should be loaded first. |
177 GURL home(homepage_); | 181 GURL home(homepage_); |
178 ASSERT_FALSE(tab_->GoBack()); | 182 ASSERT_FALSE(tab_->GoBack()); |
179 EXPECT_EQ(L"", GetTabTitle()); | 183 EXPECT_EQ(L"", GetTabTitle()); |
180 EXPECT_EQ(home, GetTabURL()); | 184 EXPECT_EQ(home, GetTabURL()); |
181 | 185 |
182 GURL frames(server.TestServerPage("files/session_history/frames.html")); | 186 GURL frames(server->TestServerPage("files/session_history/frames.html")); |
183 ASSERT_TRUE(tab_->NavigateToURL(frames)); | 187 ASSERT_TRUE(tab_->NavigateToURL(frames)); |
184 EXPECT_EQ(L"bot1", GetTabTitle()); | 188 EXPECT_EQ(L"bot1", GetTabTitle()); |
185 EXPECT_EQ(frames, GetTabURL()); | 189 EXPECT_EQ(frames, GetTabURL()); |
186 | 190 |
187 ClickLink(L"abot2"); | 191 ClickLink(L"abot2"); |
188 EXPECT_EQ(L"bot2", GetTabTitle()); | 192 EXPECT_EQ(L"bot2", GetTabTitle()); |
189 EXPECT_EQ(frames, GetTabURL()); | 193 EXPECT_EQ(frames, GetTabURL()); |
190 | 194 |
191 ClickLink(L"abot3"); | 195 ClickLink(L"abot3"); |
192 EXPECT_EQ(L"bot3", GetTabTitle()); | 196 EXPECT_EQ(L"bot3", GetTabTitle()); |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
228 EXPECT_EQ(L"bot2", GetTabTitle()); | 232 EXPECT_EQ(L"bot2", GetTabTitle()); |
229 EXPECT_EQ(frames, GetTabURL()); | 233 EXPECT_EQ(frames, GetTabURL()); |
230 | 234 |
231 ASSERT_TRUE(tab_->GoBack()); | 235 ASSERT_TRUE(tab_->GoBack()); |
232 EXPECT_EQ(L"bot1", GetTabTitle()); | 236 EXPECT_EQ(L"bot1", GetTabTitle()); |
233 EXPECT_EQ(frames, GetTabURL()); | 237 EXPECT_EQ(frames, GetTabURL()); |
234 } | 238 } |
235 | 239 |
236 // Test that back/forward preserves POST data and document state in subframes. | 240 // Test that back/forward preserves POST data and document state in subframes. |
237 TEST_F(SessionHistoryTest, FrameFormBackForward) { | 241 TEST_F(SessionHistoryTest, FrameFormBackForward) { |
238 TestServer server(kDocRoot); | 242 scoped_refptr<HTTPTestServer> server = |
| 243 HTTPTestServer::CreateServer(kDocRoot); |
| 244 ASSERT_TRUE(NULL != server.get()); |
239 | 245 |
240 // about:blank should be loaded first. | 246 // about:blank should be loaded first. |
241 ASSERT_FALSE(tab_->GoBack()); | 247 ASSERT_FALSE(tab_->GoBack()); |
242 EXPECT_EQ(L"", GetTabTitle()); | 248 EXPECT_EQ(L"", GetTabTitle()); |
243 | 249 |
244 GURL frames(server.TestServerPage("files/session_history/frames.html")); | 250 GURL frames(server->TestServerPage("files/session_history/frames.html")); |
245 ASSERT_TRUE(tab_->NavigateToURL(frames)); | 251 ASSERT_TRUE(tab_->NavigateToURL(frames)); |
246 EXPECT_EQ(L"bot1", GetTabTitle()); | 252 EXPECT_EQ(L"bot1", GetTabTitle()); |
247 | 253 |
248 ClickLink(L"aform"); | 254 ClickLink(L"aform"); |
249 EXPECT_EQ(L"form", GetTabTitle()); | 255 EXPECT_EQ(L"form", GetTabTitle()); |
250 EXPECT_EQ(frames, GetTabURL()); | 256 EXPECT_EQ(frames, GetTabURL()); |
251 | 257 |
252 SubmitForm(L"isubmit"); | 258 SubmitForm(L"isubmit"); |
253 EXPECT_EQ(L"text=&select=a", GetTabTitle()); | 259 EXPECT_EQ(L"text=&select=a", GetTabTitle()); |
254 EXPECT_EQ(frames, GetTabURL()); | 260 EXPECT_EQ(frames, GetTabURL()); |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 #endif | 294 #endif |
289 } | 295 } |
290 | 296 |
291 // TODO(mpcomplete): enable this when Bug 734372 is fixed: | 297 // TODO(mpcomplete): enable this when Bug 734372 is fixed: |
292 // "Doing a session history navigation does not restore newly-created subframe | 298 // "Doing a session history navigation does not restore newly-created subframe |
293 // document state" | 299 // document state" |
294 #if 0 | 300 #if 0 |
295 // Test that back/forward preserves POST data and document state when navigating | 301 // Test that back/forward preserves POST data and document state when navigating |
296 // across frames (ie, from frame -> nonframe). | 302 // across frames (ie, from frame -> nonframe). |
297 TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { | 303 TEST_F(SessionHistoryTest, CrossFrameFormBackForward) { |
298 TestServer server(kDocRoot); | 304 scoped_refptr<HTTPTestServer> server = |
| 305 HTTPTestServer::CreateServer(kDocRoot); |
| 306 ASSERT_TRUE(NULL != server.get()); |
299 | 307 |
300 // about:blank should be loaded first. | 308 // about:blank should be loaded first. |
301 ASSERT_FALSE(tab_->GoBack()); | 309 ASSERT_FALSE(tab_->GoBack()); |
302 EXPECT_EQ(L"", GetTabTitle()); | 310 EXPECT_EQ(L"", GetTabTitle()); |
303 | 311 |
304 GURL frames(server.TestServerPage("files/session_history/frames.html")); | 312 GURL frames(server->TestServerPage("files/session_history/frames.html")); |
305 ASSERT_TRUE(tab_->NavigateToURL(frames)); | 313 ASSERT_TRUE(tab_->NavigateToURL(frames)); |
306 EXPECT_EQ(L"bot1", GetTabTitle()); | 314 EXPECT_EQ(L"bot1", GetTabTitle()); |
307 | 315 |
308 ClickLink(L"aform"); | 316 ClickLink(L"aform"); |
309 EXPECT_EQ(L"form", GetTabTitle()); | 317 EXPECT_EQ(L"form", GetTabTitle()); |
310 EXPECT_EQ(frames, GetTabURL()); | 318 EXPECT_EQ(frames, GetTabURL()); |
311 | 319 |
312 SubmitForm(L"isubmit"); | 320 SubmitForm(L"isubmit"); |
313 EXPECT_EQ(L"text=&select=a", GetTabTitle()); | 321 EXPECT_EQ(L"text=&select=a", GetTabTitle()); |
314 EXPECT_EQ(frames, GetTabURL()); | 322 EXPECT_EQ(frames, GetTabURL()); |
(...skipping 15 matching lines...) Expand all Loading... |
330 ASSERT_TRUE(tab_->GoBack()); | 338 ASSERT_TRUE(tab_->GoBack()); |
331 EXPECT_EQ(L"form", GetTabTitle()); | 339 EXPECT_EQ(L"form", GetTabTitle()); |
332 EXPECT_EQ(frames, GetTabURL()); | 340 EXPECT_EQ(frames, GetTabURL()); |
333 | 341 |
334 SubmitForm(L"isubmit"); | 342 SubmitForm(L"isubmit"); |
335 EXPECT_EQ(L"text=&select=a", GetTabTitle()); | 343 EXPECT_EQ(L"text=&select=a", GetTabTitle()); |
336 EXPECT_EQ(frames, GetTabURL()); | 344 EXPECT_EQ(frames, GetTabURL()); |
337 } | 345 } |
338 #endif | 346 #endif |
339 | 347 |
340 // Test that back/forward entries are created for reference fragment navigations
. | 348 // Test that back/forward entries are created for reference fragment |
341 // Bug 730379. | 349 // navigations. Bug 730379. |
342 TEST_F(SessionHistoryTest, FragmentBackForward) { | 350 TEST_F(SessionHistoryTest, FragmentBackForward) { |
343 TestServer server(kDocRoot); | 351 scoped_refptr<HTTPTestServer> server = |
| 352 HTTPTestServer::CreateServer(kDocRoot); |
| 353 ASSERT_TRUE(NULL != server.get()); |
344 | 354 |
345 // about:blank should be loaded first. | 355 // about:blank should be loaded first. |
346 ASSERT_FALSE(tab_->GoBack()); | 356 ASSERT_FALSE(tab_->GoBack()); |
347 EXPECT_EQ(L"", GetTabTitle()); | 357 EXPECT_EQ(L"", GetTabTitle()); |
348 | 358 |
349 GURL fragment(server.TestServerPage("files/session_history/fragment.html")); | 359 GURL fragment(server->TestServerPage("files/session_history/fragment.html")); |
350 ASSERT_TRUE(tab_->NavigateToURL(fragment)); | 360 ASSERT_TRUE(tab_->NavigateToURL(fragment)); |
351 EXPECT_EQ(L"fragment", GetTabTitle()); | 361 EXPECT_EQ(L"fragment", GetTabTitle()); |
352 EXPECT_EQ(fragment, GetTabURL()); | 362 EXPECT_EQ(fragment, GetTabURL()); |
353 | 363 |
354 GURL::Replacements ref_params; | 364 GURL::Replacements ref_params; |
355 | 365 |
356 ref_params.SetRef("a", url_parse::Component(0, 1)); | 366 ref_params.SetRef("a", url_parse::Component(0, 1)); |
357 GURL fragment_a(fragment.ReplaceComponents(ref_params)); | 367 GURL fragment_a(fragment.ReplaceComponents(ref_params)); |
358 ASSERT_TRUE(tab_->NavigateToURL(fragment_a)); | 368 ASSERT_TRUE(tab_->NavigateToURL(fragment_a)); |
359 EXPECT_EQ(L"fragment", GetTabTitle()); | 369 EXPECT_EQ(L"fragment", GetTabTitle()); |
(...skipping 18 matching lines...) Expand all Loading... |
378 | 388 |
379 ASSERT_TRUE(tab_->GoBack()); | 389 ASSERT_TRUE(tab_->GoBack()); |
380 EXPECT_EQ(fragment_a, GetTabURL()); | 390 EXPECT_EQ(fragment_a, GetTabURL()); |
381 | 391 |
382 ASSERT_TRUE(tab_->GoBack()); | 392 ASSERT_TRUE(tab_->GoBack()); |
383 EXPECT_EQ(fragment, GetTabURL()); | 393 EXPECT_EQ(fragment, GetTabURL()); |
384 | 394 |
385 ASSERT_TRUE(tab_->GoForward()); | 395 ASSERT_TRUE(tab_->GoForward()); |
386 EXPECT_EQ(fragment_a, GetTabURL()); | 396 EXPECT_EQ(fragment_a, GetTabURL()); |
387 | 397 |
388 GURL bot3(server.TestServerPage("files/session_history/bot3.html")); | 398 GURL bot3(server->TestServerPage("files/session_history/bot3.html")); |
389 ASSERT_TRUE(tab_->NavigateToURL(bot3)); | 399 ASSERT_TRUE(tab_->NavigateToURL(bot3)); |
390 EXPECT_EQ(L"bot3", GetTabTitle()); | 400 EXPECT_EQ(L"bot3", GetTabTitle()); |
391 EXPECT_EQ(bot3, GetTabURL()); | 401 EXPECT_EQ(bot3, GetTabURL()); |
392 | 402 |
393 // history is [blank, fragment, fragment#a, bot3] | 403 // history is [blank, fragment, fragment#a, bot3] |
394 | 404 |
395 ASSERT_FALSE(tab_->GoForward()); | 405 ASSERT_FALSE(tab_->GoForward()); |
396 EXPECT_EQ(bot3, GetTabURL()); | 406 EXPECT_EQ(bot3, GetTabURL()); |
397 | 407 |
398 ASSERT_TRUE(tab_->GoBack()); | 408 ASSERT_TRUE(tab_->GoBack()); |
399 EXPECT_EQ(fragment_a, GetTabURL()); | 409 EXPECT_EQ(fragment_a, GetTabURL()); |
400 | 410 |
401 ASSERT_TRUE(tab_->GoBack()); | 411 ASSERT_TRUE(tab_->GoBack()); |
402 EXPECT_EQ(fragment, GetTabURL()); | 412 EXPECT_EQ(fragment, GetTabURL()); |
403 } | 413 } |
404 | 414 |
405 // Test that the javascript window.history object works. | 415 // Test that the javascript window.history object works. |
406 // NOTE: history.go(N) does not do anything if N is outside the bounds of the | 416 // NOTE: history.go(N) does not do anything if N is outside the bounds of the |
407 // back/forward list (such as trigger our start/stop loading events). This | 417 // back/forward list (such as trigger our start/stop loading events). This |
408 // means the test will hang if it attempts to navigate too far forward or back, | 418 // means the test will hang if it attempts to navigate too far forward or back, |
409 // since we'll be waiting forever for a load stop event. | 419 // since we'll be waiting forever for a load stop event. |
410 TEST_F(SessionHistoryTest, JavascriptHistory) { | 420 TEST_F(SessionHistoryTest, JavascriptHistory) { |
411 TestServer server(kDocRoot); | 421 scoped_refptr<HTTPTestServer> server = |
| 422 HTTPTestServer::CreateServer(kDocRoot); |
| 423 ASSERT_TRUE(NULL != server.get()); |
412 | 424 |
413 // about:blank should be loaded first. | 425 // about:blank should be loaded first. |
414 ASSERT_FALSE(tab_->GoBack()); | 426 ASSERT_FALSE(tab_->GoBack()); |
415 EXPECT_EQ(L"", GetTabTitle()); | 427 EXPECT_EQ(L"", GetTabTitle()); |
416 | 428 |
417 ASSERT_TRUE(tab_->NavigateToURL( | 429 ASSERT_TRUE(tab_->NavigateToURL( |
418 server.TestServerPage("files/session_history/bot1.html"))); | 430 server->TestServerPage("files/session_history/bot1.html"))); |
419 EXPECT_EQ(L"bot1", GetTabTitle()); | 431 EXPECT_EQ(L"bot1", GetTabTitle()); |
420 | 432 |
421 ASSERT_TRUE(tab_->NavigateToURL( | 433 ASSERT_TRUE(tab_->NavigateToURL( |
422 server.TestServerPage("files/session_history/bot2.html"))); | 434 server->TestServerPage("files/session_history/bot2.html"))); |
423 EXPECT_EQ(L"bot2", GetTabTitle()); | 435 EXPECT_EQ(L"bot2", GetTabTitle()); |
424 | 436 |
425 ASSERT_TRUE(tab_->NavigateToURL( | 437 ASSERT_TRUE(tab_->NavigateToURL( |
426 server.TestServerPage("files/session_history/bot3.html"))); | 438 server->TestServerPage("files/session_history/bot3.html"))); |
427 EXPECT_EQ(L"bot3", GetTabTitle()); | 439 EXPECT_EQ(L"bot3", GetTabTitle()); |
428 | 440 |
429 // history is [blank, bot1, bot2, *bot3] | 441 // history is [blank, bot1, bot2, *bot3] |
430 | 442 |
431 JavascriptGo("-1"); | 443 JavascriptGo("-1"); |
432 EXPECT_EQ(L"bot2", GetTabTitle()); | 444 EXPECT_EQ(L"bot2", GetTabTitle()); |
433 | 445 |
434 JavascriptGo("-1"); | 446 JavascriptGo("-1"); |
435 EXPECT_EQ(L"bot1", GetTabTitle()); | 447 EXPECT_EQ(L"bot1", GetTabTitle()); |
436 | 448 |
(...skipping 11 matching lines...) Expand all Loading... |
448 JavascriptGo("-3"); | 460 JavascriptGo("-3"); |
449 EXPECT_EQ(L"", GetTabTitle()); | 461 EXPECT_EQ(L"", GetTabTitle()); |
450 | 462 |
451 ASSERT_FALSE(tab_->GoBack()); | 463 ASSERT_FALSE(tab_->GoBack()); |
452 EXPECT_EQ(L"", GetTabTitle()); | 464 EXPECT_EQ(L"", GetTabTitle()); |
453 | 465 |
454 JavascriptGo("1"); | 466 JavascriptGo("1"); |
455 EXPECT_EQ(L"bot1", GetTabTitle()); | 467 EXPECT_EQ(L"bot1", GetTabTitle()); |
456 | 468 |
457 ASSERT_TRUE(tab_->NavigateToURL( | 469 ASSERT_TRUE(tab_->NavigateToURL( |
458 server.TestServerPage("files/session_history/bot3.html"))); | 470 server->TestServerPage("files/session_history/bot3.html"))); |
459 EXPECT_EQ(L"bot3", GetTabTitle()); | 471 EXPECT_EQ(L"bot3", GetTabTitle()); |
460 | 472 |
461 // history is [blank, bot1, *bot3] | 473 // history is [blank, bot1, *bot3] |
462 | 474 |
463 ASSERT_FALSE(tab_->GoForward()); | 475 ASSERT_FALSE(tab_->GoForward()); |
464 EXPECT_EQ(L"bot3", GetTabTitle()); | 476 EXPECT_EQ(L"bot3", GetTabTitle()); |
465 | 477 |
466 JavascriptGo("-1"); | 478 JavascriptGo("-1"); |
467 EXPECT_EQ(L"bot1", GetTabTitle()); | 479 EXPECT_EQ(L"bot1", GetTabTitle()); |
468 | 480 |
(...skipping 13 matching lines...) Expand all Loading... |
482 // types. For example, load about:network in a tab, then a real page, then | 494 // types. For example, load about:network in a tab, then a real page, then |
483 // try to go back and forward with JavaScript. Bug 1136715. | 495 // try to go back and forward with JavaScript. Bug 1136715. |
484 // (Hard to test right now, because pages like about:network cause the | 496 // (Hard to test right now, because pages like about:network cause the |
485 // TabProxy to hang. This is because they do not appear to use the | 497 // TabProxy to hang. This is because they do not appear to use the |
486 // NotificationService.) | 498 // NotificationService.) |
487 } | 499 } |
488 | 500 |
489 TEST_F(SessionHistoryTest, LocationReplace) { | 501 TEST_F(SessionHistoryTest, LocationReplace) { |
490 // Test that using location.replace doesn't leave the title of the old page | 502 // Test that using location.replace doesn't leave the title of the old page |
491 // visible. | 503 // visible. |
492 TestServer server(kDocRoot); | 504 scoped_refptr<HTTPTestServer> server = |
| 505 HTTPTestServer::CreateServer(kDocRoot); |
| 506 ASSERT_TRUE(NULL != server.get()); |
493 | 507 |
494 ASSERT_TRUE(tab_->NavigateToURL( | 508 ASSERT_TRUE(tab_->NavigateToURL(server->TestServerPage( |
495 server.TestServerPage("files/session_history/replace.html?no-title.html"))
); | 509 "files/session_history/replace.html?no-title.html"))); |
496 EXPECT_EQ(L"", GetTabTitle()); | 510 EXPECT_EQ(L"", GetTabTitle()); |
497 } | 511 } |
498 | 512 |
OLD | NEW |