1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* test/win32ole/test_err_in_callback.rb: InternetExplorer should

be closed.

* test/win32ole/err_in_callback.rb: ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19284 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
suke 2008-09-10 12:15:04 +00:00
parent 3cf69b5d69
commit 22fe262119
3 changed files with 26 additions and 15 deletions

View file

@ -1,3 +1,10 @@
Wed Sep 10 21:09:32 2008 Masaki Suketa <masaki.suketa@nifty.ne.jp>
* test/win32ole/test_err_in_callback.rb: InternetExplorer should
be closed.
* test/win32ole/err_in_callback.rb: ditto.
Wed Sep 10 18:25:19 2008 akira yamada <akira@rice.p.arika.org> Wed Sep 10 18:25:19 2008 akira yamada <akira@rice.p.arika.org>
* lib/uri/common.rb (URI::Parser): new class. * lib/uri/common.rb (URI::Parser): new class.

View file

@ -5,7 +5,11 @@ WIN32OLE_EVENT.message_loop
sleep 0.2 sleep 0.2
ev = WIN32OLE_EVENT.new(ie) ev = WIN32OLE_EVENT.new(ie)
ev.on_event('BeforeNavigate2') {|*args| ev.on_event('NavigateComplete2') {|*args|
foo foo
} }
ie.navigate(ARGV.shift) ie.navigate(ARGV.shift)
while ie.readystate != 4
WIN32OLE_EVENT.message_loop
sleep 0.2
end

View file

@ -28,14 +28,14 @@ if defined?(WIN32OLE)
def create_temp_html def create_temp_html
fso = WIN32OLE.new('Scripting.FileSystemObject') fso = WIN32OLE.new('Scripting.FileSystemObject')
dummy_file = fso.GetTempName + ".html" @dummy_file = fso.GetTempName + ".html"
cfolder = fso.getFolder(".") cfolder = fso.getFolder(".")
@str = "This is test HTML file for Win32OLE (#{Time.now})" @str = "This is test HTML file for Win32OLE (#{Time.now})"
f = cfolder.CreateTextFile(dummy_file) f = cfolder.CreateTextFile(@dummy_file)
f.writeLine("<html><body><div id='str'>#{@str}</div></body></html>") f.writeLine("<html><body><div id='str'>#{@str}</div></body></html>")
f.close f.close
@f = dummy_file @f = @dummy_file
dummy_path = cfolder.path + "\\" + dummy_file dummy_path = cfolder.path + "\\" + @dummy_file
dummy_path dummy_path
end end
@ -54,26 +54,26 @@ if defined?(WIN32OLE)
def ie_quit def ie_quit
sh = WIN32OLE.new('Shell.Application') sh = WIN32OLE.new('Shell.Application')
sh.windows.each do |w| sh.windows.each do |w|
if w.ole_type.name == 'IWebBrowser2' i = 0
20.times do |i| begin
if w.locationURL != "" && w.document i = i + 1
break WIN32OLE_EVENT.message_loop
end sleep 0.1
WIN32OLE_EVENT.message_loop e = w.document.all.item("str")
sleep 1
end
e = w.document.getElementById("str")
if e && e.innerHTML == @str if e && e.innerHTML == @str
w.quit w.quit
WIN32OLE_EVENT.message_loop WIN32OLE_EVENT.message_loop
sleep 0.2 sleep 0.2
break
end end
next if i > 1000
rescue
retry
end end
end end
end end
def teardown def teardown
WIN32OLE_EVENT.message_loop
ie_quit ie_quit
File.unlink(@f) File.unlink(@f)
File.unlink("test_err_in_callback.log") File.unlink("test_err_in_callback.log")