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/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/message_box_flags.h" | 9 #include "app/message_box_flags.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 // compare canonical urls... | 382 // compare canonical urls... |
383 ASSERT_STREQ(newurl.spec().c_str(), url.spec().c_str()); | 383 ASSERT_STREQ(newurl.spec().c_str(), url.spec().c_str()); |
384 } | 384 } |
385 | 385 |
386 class AutomationProxyTest2 : public AutomationProxyVisibleTest { | 386 class AutomationProxyTest2 : public AutomationProxyVisibleTest { |
387 protected: | 387 protected: |
388 AutomationProxyTest2() { | 388 AutomationProxyTest2() { |
389 document1_= test_data_directory_.AppendASCII("title1.html"); | 389 document1_= test_data_directory_.AppendASCII("title1.html"); |
390 | 390 |
391 document2_ = test_data_directory_.AppendASCII("title2.html"); | 391 document2_ = test_data_directory_.AppendASCII("title2.html"); |
392 launch_arguments_ = CommandLine(L""); | 392 launch_arguments_ = CommandLine(CommandLine::ARGUMENTS_ONLY); |
393 launch_arguments_.AppendLooseValue(document1_.ToWStringHack()); | 393 launch_arguments_.AppendLooseValue(document1_.ToWStringHack()); |
394 launch_arguments_.AppendLooseValue(document2_.ToWStringHack()); | 394 launch_arguments_.AppendLooseValue(document2_.ToWStringHack()); |
395 } | 395 } |
396 | 396 |
397 FilePath document1_; | 397 FilePath document1_; |
398 FilePath document2_; | 398 FilePath document2_; |
399 }; | 399 }; |
400 | 400 |
401 TEST_F(AutomationProxyTest2, GetActiveTabIndex) { | 401 TEST_F(AutomationProxyTest2, GetActiveTabIndex) { |
402 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); | 402 scoped_refptr<BrowserProxy> window(automation()->GetBrowserWindow(0)); |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
563 // type value | 563 // type value |
564 | 564 |
565 class AutomationProxyTest3 : public UITest { | 565 class AutomationProxyTest3 : public UITest { |
566 protected: | 566 protected: |
567 AutomationProxyTest3() : UITest() { | 567 AutomationProxyTest3() : UITest() { |
568 document1_ = test_data_directory_; | 568 document1_ = test_data_directory_; |
569 document1_ = document1_.AppendASCII("frame_dom_access"); | 569 document1_ = document1_.AppendASCII("frame_dom_access"); |
570 document1_ = document1_.AppendASCII("frame_dom_access.html"); | 570 document1_ = document1_.AppendASCII("frame_dom_access.html"); |
571 | 571 |
572 dom_automation_enabled_ = true; | 572 dom_automation_enabled_ = true; |
573 launch_arguments_ = CommandLine(L""); | 573 launch_arguments_ = CommandLine(CommandLine::ARGUMENTS_ONLY); |
574 launch_arguments_.AppendLooseValue(document1_.ToWStringHack()); | 574 launch_arguments_.AppendLooseValue(document1_.ToWStringHack()); |
575 } | 575 } |
576 | 576 |
577 FilePath document1_; | 577 FilePath document1_; |
578 }; | 578 }; |
579 | 579 |
580 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { | 580 std::wstring CreateJSStringForDOMQuery(const std::wstring& id) { |
581 std::wstring jscript(L"window.domAutomationController"); | 581 std::wstring jscript(L"window.domAutomationController"); |
582 StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", | 582 StringAppendF(&jscript, L".send(document.getElementById('%ls').nodeName);", |
583 id.c_str()); | 583 id.c_str()); |
(...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1182 | 1182 |
1183 // Allow some time for the popup to show up and close. | 1183 // Allow some time for the popup to show up and close. |
1184 PlatformThread::Sleep(2000); | 1184 PlatformThread::Sleep(2000); |
1185 | 1185 |
1186 std::wstring expected(L"string"); | 1186 std::wstring expected(L"string"); |
1187 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); | 1187 std::wstring jscript = CreateJSString(L"\"" + expected + L"\""); |
1188 std::wstring actual; | 1188 std::wstring actual; |
1189 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); | 1189 ASSERT_TRUE(tab->ExecuteAndExtractString(L"", jscript, &actual)); |
1190 ASSERT_EQ(expected, actual); | 1190 ASSERT_EQ(expected, actual); |
1191 } | 1191 } |
OLD | NEW |