| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "base/compiler_specific.h" | 7 #include "base/compiler_specific.h" |
| 8 | 8 |
| 9 MSVC_PUSH_WARNING_LEVEL(0); | 9 MSVC_PUSH_WARNING_LEVEL(0); |
| 10 #include "Document.h" | 10 #include "Document.h" |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 static_cast<unsigned>(end_pos - start_pos)); | 231 static_cast<unsigned>(end_pos - start_pos)); |
| 232 return true; | 232 return true; |
| 233 } | 233 } |
| 234 } | 234 } |
| 235 return true; | 235 return true; |
| 236 } | 236 } |
| 237 | 237 |
| 238 // If original contents have document type, the serialized contents also have | 238 // If original contents have document type, the serialized contents also have |
| 239 // document type. | 239 // document type. |
| 240 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithDocType) { | 240 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithDocType) { |
| 241 std::wstring page_file_path = data_dir_; | 241 FilePath page_file_path = data_dir_; |
| 242 file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_1.htm"); | 242 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 243 page_file_path = page_file_path.AppendASCII("youtube_1.htm"); |
| 243 GURL file_url = net::FilePathToFileURL(page_file_path); | 244 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 244 ASSERT_TRUE(file_url.SchemeIsFile()); | 245 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 245 // Load the test file. | 246 // Load the test file. |
| 246 LoadPageFromURL(file_url); | 247 LoadPageFromURL(file_url); |
| 247 // Make sure original contents have document type. | 248 // Make sure original contents have document type. |
| 248 WebFrameImpl* web_frame = | 249 WebFrameImpl* web_frame = |
| 249 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 250 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
| 250 test_shell_->webView(), file_url); | 251 test_shell_->webView(), file_url); |
| 251 ASSERT_TRUE(web_frame != NULL); | 252 ASSERT_TRUE(web_frame != NULL); |
| 252 WebCore::Document* doc = web_frame->frame()->document(); | 253 WebCore::Document* doc = web_frame->frame()->document(); |
| 253 ASSERT_TRUE(doc->doctype() != NULL); | 254 ASSERT_TRUE(doc->doctype() != NULL); |
| 254 // Do serialization. | 255 // Do serialization. |
| 255 SerializeDomForURL(file_url, false); | 256 SerializeDomForURL(file_url, false); |
| 256 // Load the serialized contents. | 257 // Load the serialized contents. |
| 257 ASSERT_TRUE(HasSerializedFrame(file_url)); | 258 ASSERT_TRUE(HasSerializedFrame(file_url)); |
| 258 const std::string& serialized_contents = | 259 const std::string& serialized_contents = |
| 259 GetSerializedContentForFrame(file_url); | 260 GetSerializedContentForFrame(file_url); |
| 260 LoadContents(serialized_contents, file_url, | 261 LoadContents(serialized_contents, file_url, |
| 261 web_frame->frame()->loader()->encoding()); | 262 web_frame->frame()->loader()->encoding()); |
| 262 // Make sure serialized contents still have document type. | 263 // Make sure serialized contents still have document type. |
| 263 web_frame = | 264 web_frame = |
| 264 static_cast<WebFrameImpl*>(test_shell_->webView()->GetMainFrame()); | 265 static_cast<WebFrameImpl*>(test_shell_->webView()->GetMainFrame()); |
| 265 doc = web_frame->frame()->document(); | 266 doc = web_frame->frame()->document(); |
| 266 ASSERT_TRUE(doc->doctype() != NULL); | 267 ASSERT_TRUE(doc->doctype() != NULL); |
| 267 } | 268 } |
| 268 | 269 |
| 269 // If original contents do not have document type, the serialized contents | 270 // If original contents do not have document type, the serialized contents |
| 270 // also do not have document type. | 271 // also do not have document type. |
| 271 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithoutDocType) { | 272 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithoutDocType) { |
| 272 std::wstring page_file_path = data_dir_; | 273 FilePath page_file_path = data_dir_; |
| 273 file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm"); | 274 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 275 page_file_path = page_file_path.AppendASCII("youtube_2.htm"); |
| 274 GURL file_url = net::FilePathToFileURL(page_file_path); | 276 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 275 ASSERT_TRUE(file_url.SchemeIsFile()); | 277 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 276 // Load the test file. | 278 // Load the test file. |
| 277 LoadPageFromURL(file_url); | 279 LoadPageFromURL(file_url); |
| 278 // Make sure original contents do not have document type. | 280 // Make sure original contents do not have document type. |
| 279 WebFrameImpl* web_frame = | 281 WebFrameImpl* web_frame = |
| 280 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 282 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
| 281 test_shell_->webView(), file_url); | 283 test_shell_->webView(), file_url); |
| 282 ASSERT_TRUE(web_frame != NULL); | 284 ASSERT_TRUE(web_frame != NULL); |
| 283 WebCore::Document* doc = web_frame->frame()->document(); | 285 WebCore::Document* doc = web_frame->frame()->document(); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 294 web_frame = | 296 web_frame = |
| 295 static_cast<WebFrameImpl*>(test_shell_->webView()->GetMainFrame()); | 297 static_cast<WebFrameImpl*>(test_shell_->webView()->GetMainFrame()); |
| 296 doc = web_frame->frame()->document(); | 298 doc = web_frame->frame()->document(); |
| 297 ASSERT_TRUE(doc->doctype() == NULL); | 299 ASSERT_TRUE(doc->doctype() == NULL); |
| 298 } | 300 } |
| 299 | 301 |
| 300 // Serialize XML document which has all 5 built-in entities. After | 302 // Serialize XML document which has all 5 built-in entities. After |
| 301 // finishing serialization, the serialized contents should be same | 303 // finishing serialization, the serialized contents should be same |
| 302 // with original XML document. | 304 // with original XML document. |
| 303 TEST_F(DomSerializerTests, SerialzeXMLDocWithBuiltInEntities) { | 305 TEST_F(DomSerializerTests, SerialzeXMLDocWithBuiltInEntities) { |
| 304 std::wstring page_file_path = data_dir_; | 306 FilePath page_file_path = data_dir_; |
| 305 file_util::AppendToPath(&page_file_path, L"dom_serializer/note.xml"); | 307 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 308 page_file_path = page_file_path.AppendASCII("note.xml"); |
| 306 // Read original contents for later comparison. | 309 // Read original contents for later comparison. |
| 307 std::string orginal_contents; | 310 std::string orginal_contents; |
| 308 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); | 311 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); |
| 309 // Get file URL. | 312 // Get file URL. |
| 310 GURL file_url = net::FilePathToFileURL(page_file_path); | 313 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 311 ASSERT_TRUE(file_url.SchemeIsFile()); | 314 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 312 // Load the test file. | 315 // Load the test file. |
| 313 LoadPageFromURL(file_url); | 316 LoadPageFromURL(file_url); |
| 314 // Do serialization. | 317 // Do serialization. |
| 315 SerializeDomForURL(file_url, false); | 318 SerializeDomForURL(file_url, false); |
| 316 // Compare the serialized contents with original contents. | 319 // Compare the serialized contents with original contents. |
| 317 ASSERT_TRUE(HasSerializedFrame(file_url)); | 320 ASSERT_TRUE(HasSerializedFrame(file_url)); |
| 318 const std::string& serialized_contents = | 321 const std::string& serialized_contents = |
| 319 GetSerializedContentForFrame(file_url); | 322 GetSerializedContentForFrame(file_url); |
| 320 ASSERT_EQ(orginal_contents, serialized_contents); | 323 ASSERT_EQ(orginal_contents, serialized_contents); |
| 321 } | 324 } |
| 322 | 325 |
| 323 // When serializing DOM, we add MOTW declaration before html tag. | 326 // When serializing DOM, we add MOTW declaration before html tag. |
| 324 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithAddingMOTW) { | 327 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithAddingMOTW) { |
| 325 std::wstring page_file_path = data_dir_; | 328 FilePath page_file_path = data_dir_; |
| 326 file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm"); | 329 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 330 page_file_path = page_file_path.AppendASCII("youtube_2.htm"); |
| 327 // Read original contents for later comparison . | 331 // Read original contents for later comparison . |
| 328 std::string orginal_contents; | 332 std::string orginal_contents; |
| 329 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); | 333 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); |
| 330 // Get file URL. | 334 // Get file URL. |
| 331 GURL file_url = net::FilePathToFileURL(page_file_path); | 335 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 332 ASSERT_TRUE(file_url.SchemeIsFile()); | 336 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 333 // Make sure original contents does not have MOTW; | 337 // Make sure original contents does not have MOTW; |
| 334 std::string motw_declaration = | 338 std::string motw_declaration = |
| 335 webkit_glue::DomSerializer::GenerateMarkOfTheWebDeclaration(file_url); | 339 webkit_glue::DomSerializer::GenerateMarkOfTheWebDeclaration(file_url); |
| 336 ASSERT_FALSE(motw_declaration.empty()); | 340 ASSERT_FALSE(motw_declaration.empty()); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 348 GetSerializedContentForFrame(file_url); | 352 GetSerializedContentForFrame(file_url); |
| 349 ASSERT_FALSE(std::string::npos == | 353 ASSERT_FALSE(std::string::npos == |
| 350 serialized_contents.find(motw_declaration)); | 354 serialized_contents.find(motw_declaration)); |
| 351 } | 355 } |
| 352 | 356 |
| 353 // When serializing DOM, we will add the META which have correct charset | 357 // When serializing DOM, we will add the META which have correct charset |
| 354 // declaration as first child of HEAD element for resolving WebKit bug: | 358 // declaration as first child of HEAD element for resolving WebKit bug: |
| 355 // http://bugs.webkit.org/show_bug.cgi?id=16621 even the original document | 359 // http://bugs.webkit.org/show_bug.cgi?id=16621 even the original document |
| 356 // does not have META charset declaration. | 360 // does not have META charset declaration. |
| 357 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithNoMetaCharsetInOriginalDoc) { | 361 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithNoMetaCharsetInOriginalDoc) { |
| 358 std::wstring page_file_path = data_dir_; | 362 FilePath page_file_path = data_dir_; |
| 359 file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_1.htm"); | 363 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 364 page_file_path = page_file_path.AppendASCII("youtube_1.htm"); |
| 360 // Get file URL. | 365 // Get file URL. |
| 361 GURL file_url = net::FilePathToFileURL(page_file_path); | 366 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 362 ASSERT_TRUE(file_url.SchemeIsFile()); | 367 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 363 // Load the test file. | 368 // Load the test file. |
| 364 LoadPageFromURL(file_url); | 369 LoadPageFromURL(file_url); |
| 365 | 370 |
| 366 // Make sure there is no META charset declaration in original document. | 371 // Make sure there is no META charset declaration in original document. |
| 367 WebFrameImpl* web_frame = | 372 WebFrameImpl* web_frame = |
| 368 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 373 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
| 369 test_shell_->webView(), file_url); | 374 test_shell_->webView(), file_url); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 if (IsMetaElement(child, &charset_info)) | 415 if (IsMetaElement(child, &charset_info)) |
| 411 ASSERT_TRUE(charset_info.isEmpty()); | 416 ASSERT_TRUE(charset_info.isEmpty()); |
| 412 } | 417 } |
| 413 | 418 |
| 414 // When serializing DOM, if the original document has multiple META charset | 419 // When serializing DOM, if the original document has multiple META charset |
| 415 // declaration, we will add the META which have correct charset declaration | 420 // declaration, we will add the META which have correct charset declaration |
| 416 // as first child of HEAD element and remove all original META charset | 421 // as first child of HEAD element and remove all original META charset |
| 417 // declarations. | 422 // declarations. |
| 418 TEST_F(DomSerializerTests, | 423 TEST_F(DomSerializerTests, |
| 419 SerialzeHTMLDOMWithMultipleMetaCharsetInOriginalDoc) { | 424 SerialzeHTMLDOMWithMultipleMetaCharsetInOriginalDoc) { |
| 420 std::wstring page_file_path = data_dir_; | 425 FilePath page_file_path = data_dir_; |
| 421 file_util::AppendToPath(&page_file_path, L"dom_serializer/youtube_2.htm"); | 426 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 427 page_file_path = page_file_path.AppendASCII("youtube_2.htm"); |
| 422 // Get file URL. | 428 // Get file URL. |
| 423 GURL file_url = net::FilePathToFileURL(page_file_path); | 429 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 424 ASSERT_TRUE(file_url.SchemeIsFile()); | 430 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 425 // Load the test file. | 431 // Load the test file. |
| 426 LoadPageFromURL(file_url); | 432 LoadPageFromURL(file_url); |
| 427 | 433 |
| 428 // Make sure there are multiple META charset declarations in original | 434 // Make sure there are multiple META charset declarations in original |
| 429 // document. | 435 // document. |
| 430 WebFrameImpl* web_frame = | 436 WebFrameImpl* web_frame = |
| 431 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 437 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 479 |
| 474 // Make sure no more additional META tags which have charset declaration. | 480 // Make sure no more additional META tags which have charset declaration. |
| 475 for (const WebCore::Node *child = meta_node->nextSibling(); child != NULL; | 481 for (const WebCore::Node *child = meta_node->nextSibling(); child != NULL; |
| 476 child = child->nextSibling()) | 482 child = child->nextSibling()) |
| 477 if (IsMetaElement(child, &charset_info)) | 483 if (IsMetaElement(child, &charset_info)) |
| 478 ASSERT_TRUE(charset_info.isEmpty()); | 484 ASSERT_TRUE(charset_info.isEmpty()); |
| 479 } | 485 } |
| 480 | 486 |
| 481 // Test situation of html entities in text when serializing HTML DOM. | 487 // Test situation of html entities in text when serializing HTML DOM. |
| 482 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) { | 488 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInText) { |
| 483 std::wstring page_file_path = data_dir_; | 489 FilePath page_file_path = data_dir_; |
| 484 file_util::AppendToPath(&page_file_path, | 490 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 485 L"dom_serializer/htmlentities_in_text.htm"); | 491 page_file_path = page_file_path.AppendASCII("htmlentities_in_text.htm"); |
| 486 // Read original contents for later comparison . | 492 // Read original contents for later comparison . |
| 487 std::string orginal_contents; | 493 std::string orginal_contents; |
| 488 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); | 494 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); |
| 489 // Get file URL. | 495 // Get file URL. |
| 490 GURL file_url = net::FilePathToFileURL(page_file_path); | 496 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 491 ASSERT_TRUE(file_url.SchemeIsFile()); | 497 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 492 // Load the test file. | 498 // Load the test file. |
| 493 LoadPageFromURL(file_url); | 499 LoadPageFromURL(file_url); |
| 494 // Get BODY's text content in DOM. | 500 // Get BODY's text content in DOM. |
| 495 WebFrameImpl* web_frame = | 501 WebFrameImpl* web_frame = |
| (...skipping 17 matching lines...) Expand all Loading... |
| 513 // need to add MOTW to original_contents. | 519 // need to add MOTW to original_contents. |
| 514 std::string motw_declaration = | 520 std::string motw_declaration = |
| 515 webkit_glue::DomSerializer::GenerateMarkOfTheWebDeclaration(file_url); | 521 webkit_glue::DomSerializer::GenerateMarkOfTheWebDeclaration(file_url); |
| 516 orginal_contents = motw_declaration + orginal_contents; | 522 orginal_contents = motw_declaration + orginal_contents; |
| 517 ASSERT_EQ(orginal_contents, serialized_contents); | 523 ASSERT_EQ(orginal_contents, serialized_contents); |
| 518 } | 524 } |
| 519 | 525 |
| 520 // Test situation of html entities in attribute value when serializing | 526 // Test situation of html entities in attribute value when serializing |
| 521 // HTML DOM. | 527 // HTML DOM. |
| 522 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInAttributeValue) { | 528 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithEntitiesInAttributeValue) { |
| 523 std::wstring page_file_path = data_dir_; | 529 FilePath page_file_path = data_dir_; |
| 524 file_util::AppendToPath(&page_file_path, | 530 page_file_path = page_file_path.AppendASCII("dom_serializer"); |
| 525 L"dom_serializer/htmlentities_in_attribute_value.htm"); | 531 page_file_path = |
| 532 page_file_path.AppendASCII("htmlentities_in_attribute_value.htm"); |
| 526 // Read original contents for later comparison. | 533 // Read original contents for later comparison. |
| 527 std::string orginal_contents; | 534 std::string orginal_contents; |
| 528 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); | 535 ASSERT_TRUE(file_util::ReadFileToString(page_file_path, &orginal_contents)); |
| 529 // Get file URL. | 536 // Get file URL. |
| 530 GURL file_url = net::FilePathToFileURL(page_file_path); | 537 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 531 ASSERT_TRUE(file_url.SchemeIsFile()); | 538 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 532 // Load the test file. | 539 // Load the test file. |
| 533 LoadPageFromURL(file_url); | 540 LoadPageFromURL(file_url); |
| 534 // Get value of BODY's title attribute in DOM. | 541 // Get value of BODY's title attribute in DOM. |
| 535 WebFrameImpl* web_frame = | 542 WebFrameImpl* web_frame = |
| (...skipping 22 matching lines...) Expand all Loading... |
| 558 } | 565 } |
| 559 | 566 |
| 560 // Test situation of BASE tag in original document when serializing HTML DOM. | 567 // Test situation of BASE tag in original document when serializing HTML DOM. |
| 561 // When serializing, we should comment the BASE tag, append a new BASE tag. | 568 // When serializing, we should comment the BASE tag, append a new BASE tag. |
| 562 // rewrite all the savable URLs to relative local path, and change other URLs | 569 // rewrite all the savable URLs to relative local path, and change other URLs |
| 563 // to absolute URLs. | 570 // to absolute URLs. |
| 564 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) { | 571 TEST_F(DomSerializerTests, SerialzeHTMLDOMWithBaseTag) { |
| 565 // There are total 2 available base tags in this test file. | 572 // There are total 2 available base tags in this test file. |
| 566 const int kTotalBaseTagCountInTestFile = 2; | 573 const int kTotalBaseTagCountInTestFile = 2; |
| 567 | 574 |
| 568 FilePath page_file_path = FilePath::FromWStringHack(data_dir_).AppendASCII( | 575 FilePath page_file_path = data_dir_.AppendASCII("dom_serializer"); |
| 569 "dom_serializer"); | |
| 570 file_util::EnsureEndsWithSeparator(&page_file_path); | 576 file_util::EnsureEndsWithSeparator(&page_file_path); |
| 571 | 577 |
| 572 // Get page dir URL which is base URL of this file. | 578 // Get page dir URL which is base URL of this file. |
| 573 GURL path_dir_url = net::FilePathToFileURL(page_file_path.ToWStringHack()); | 579 GURL path_dir_url = net::FilePathToFileURL(page_file_path); |
| 574 // Get file path. | 580 // Get file path. |
| 575 page_file_path = | 581 page_file_path = |
| 576 page_file_path.AppendASCII("html_doc_has_base_tag.htm"); | 582 page_file_path.AppendASCII("html_doc_has_base_tag.htm"); |
| 577 // Get file URL. | 583 // Get file URL. |
| 578 GURL file_url = net::FilePathToFileURL(page_file_path.ToWStringHack()); | 584 GURL file_url = net::FilePathToFileURL(page_file_path); |
| 579 ASSERT_TRUE(file_url.SchemeIsFile()); | 585 ASSERT_TRUE(file_url.SchemeIsFile()); |
| 580 // Load the test file. | 586 // Load the test file. |
| 581 LoadPageFromURL(file_url); | 587 LoadPageFromURL(file_url); |
| 582 // Since for this test, we assume there is no savable sub-resource links for | 588 // Since for this test, we assume there is no savable sub-resource links for |
| 583 // this test file, also all links are relative URLs in this test file, so we | 589 // this test file, also all links are relative URLs in this test file, so we |
| 584 // need to check those relative URLs and make sure document has BASE tag. | 590 // need to check those relative URLs and make sure document has BASE tag. |
| 585 WebFrameImpl* web_frame = | 591 WebFrameImpl* web_frame = |
| 586 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( | 592 webkit_glue::GetWebFrameImplFromWebViewForSpecificURL( |
| 587 test_shell_->webView(), file_url); | 593 test_shell_->webView(), file_url); |
| 588 ASSERT_TRUE(web_frame != NULL); | 594 ASSERT_TRUE(web_frame != NULL); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 667 } | 673 } |
| 668 // We have one more added BASE tag which is generated by JavaScript. | 674 // We have one more added BASE tag which is generated by JavaScript. |
| 669 ASSERT_EQ(new_base_tag_count, original_base_tag_count + 1); | 675 ASSERT_EQ(new_base_tag_count, original_base_tag_count + 1); |
| 670 // Make sure in new document, the base URL is equal with the |path_dir_url|. | 676 // Make sure in new document, the base URL is equal with the |path_dir_url|. |
| 671 GURL new_base_url( | 677 GURL new_base_url( |
| 672 webkit_glue::StringToStdString(doc->baseURL())); | 678 webkit_glue::StringToStdString(doc->baseURL())); |
| 673 ASSERT_EQ(new_base_url, path_dir_url); | 679 ASSERT_EQ(new_base_url, path_dir_url); |
| 674 } | 680 } |
| 675 | 681 |
| 676 } // namespace | 682 } // namespace |
| OLD | NEW |