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