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 <string> | 5 #include <string> |
6 | 6 |
7 #include "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "app/message_box_flags.h" | 8 #include "app/message_box_flags.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 // compare canonical urls... | 336 // compare canonical urls... |
337 ASSERT_STREQ(newurl.spec().c_str(), url.spec().c_str()); | 337 ASSERT_STREQ(newurl.spec().c_str(), url.spec().c_str()); |
338 } | 338 } |
339 | 339 |
340 class AutomationProxyTest2 : public AutomationProxyVisibleTest { | 340 class AutomationProxyTest2 : public AutomationProxyVisibleTest { |
341 protected: | 341 protected: |
342 AutomationProxyTest2() { | 342 AutomationProxyTest2() { |
343 document1_= test_data_directory_.AppendASCII("title1.html"); | 343 document1_= test_data_directory_.AppendASCII("title1.html"); |
344 | 344 |
345 document2_ = test_data_directory_.AppendASCII("title2.html"); | 345 document2_ = test_data_directory_.AppendASCII("title2.html"); |
346 launch_arguments_ = CommandLine(CommandLine::ARGUMENTS_ONLY); | 346 launch_arguments_ = CommandLine(CommandLine::NO_PROGRAM); |
347 launch_arguments_.AppendArgPath(document1_); | 347 launch_arguments_.AppendArgPath(document1_); |
348 launch_arguments_.AppendArgPath(document2_); | 348 launch_arguments_.AppendArgPath(document2_); |
349 } | 349 } |
350 | 350 |
351 FilePath document1_; | 351 FilePath document1_; |
352 FilePath document2_; | 352 FilePath document2_; |
353 }; | 353 }; |
354 | 354 |
355 TEST_F(AutomationProxyTest2, GetActiveTabIndex) { | 355 TEST_F(AutomationProxyTest2, GetActiveTabIndex) { |
356 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 356 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // type value | 553 // type value |
554 | 554 |
555 class AutomationProxyTest3 : public UITest { | 555 class AutomationProxyTest3 : public UITest { |
556 protected: | 556 protected: |
557 AutomationProxyTest3() : UITest() { | 557 AutomationProxyTest3() : UITest() { |
558 document1_ = test_data_directory_; | 558 document1_ = test_data_directory_; |
559 document1_ = document1_.AppendASCII("frame_dom_access"); | 559 document1_ = document1_.AppendASCII("frame_dom_access"); |
560 document1_ = document1_.AppendASCII("frame_dom_access.html"); | 560 document1_ = document1_.AppendASCII("frame_dom_access.html"); |
561 | 561 |
562 dom_automation_enabled_ = true; | 562 dom_automation_enabled_ = true; |
563 launch_arguments_ = CommandLine(CommandLine::ARGUMENTS_ONLY); | 563 launch_arguments_ = CommandLine(CommandLine::NO_PROGRAM); |
564 launch_arguments_.AppendArgPath(document1_); | 564 launch_arguments_.AppendArgPath(document1_); |
565 } | 565 } |
566 | 566 |
567 FilePath document1_; | 567 FilePath document1_; |
568 }; | 568 }; |
569 | 569 |
570 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { | 570 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { |
571 std::wstring jscript(L"window.domAutomationController"); | 571 std::wstring jscript(L"window.domAutomationController"); |
572 StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", | 572 StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", |
573 id.c_str()); | 573 id.c_str()); |
(...skipping 916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1490 | 1490 |
1491 // Allow some time for the popup to show up and close. | 1491 // Allow some time for the popup to show up and close. |
1492 PlatformThread::Sleep(sleep_timeout_ms()); | 1492 PlatformThread::Sleep(sleep_timeout_ms()); |
1493 | 1493 |
1494 std::wstring expected(L"string"); | 1494 std::wstring expected(L"string"); |
1495 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1495 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1496 std::wstring actual; | 1496 std::wstring actual; |
1497 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1497 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1498 ASSERT_EQ(expected, actual); | 1498 ASSERT_EQ(expected, actual); |
1499 } | 1499 } |
OLD | NEW |