Created
August 9, 2012 02:37
-
-
Save npow/3300428 to your computer and use it in GitHub Desktop.
JS Heap Size
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'rubygems' | |
require 'watir-webdriver' | |
browser = Watir::Browser.new :chrome, :switches => %w[--enable-memory-info --enable-popup-blocking] | |
browser.goto 'file:///Users/npow/code/hydrogen/test.html' | |
browser.execute_script "document.getElementById('usedJSHeapSize').innerHTML = console.memory.usedJSHeapSize;" | |
hs = browser.div(:id => 'usedJSHeapSize') | |
puts hs.text |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment