Skip to content

Instantly share code, notes, and snippets.

@wwwillchen
Created January 13, 2017 22:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wwwillchen/b8792d485fde465430aab1288db1e7e0 to your computer and use it in GitHub Desktop.
Save wwwillchen/b8792d485fde465430aab1288db1e7e0 to your computer and use it in GitHub Desktop.
Copy Failed Layout Tests as a Bookmark
javascript:var $jscomp={scope:{}};$jscomp.defineProperty="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){if(c.get||c.set)throw new TypeError("ES3 does not support getters and setters.");a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};$jscomp.getGlobal=function(a){return"undefined"!=typeof window&&window===a?a:"undefined"!=typeof global?global:a};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(a){return $jscomp.SYMBOL_PREFIX+(a||"")+$jscomp.symbolCounter_++};$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var a=$jscomp.global.Symbol.iterator;a||(a=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[a]&&$jscomp.defineProperty(Array.prototype,a,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(a){var b=0;return $jscomp.iteratorPrototype(function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}})};$jscomp.iteratorPrototype=function(a){$jscomp.initSymbolIterator();a={next:a};a[$jscomp.global.Symbol.iterator]=function(){return this};return a};$jscomp.makeIterator=function(a){$jscomp.initSymbolIterator();var b=a[Symbol.iterator];return b?b.call(a):$jscomp.arrayIterator(a)};function allLinks(){for(var a=[],b=$jscomp.makeIterator(["#results-table tbody:not(.expected) .test-link","#timeout-tests-table > table tbody:not(.expected) .test-link"]),c=b.next();!c.done;c=b.next())a=a.concat(Array.prototype.slice.call(document.querySelectorAll(c.value)));return a}function copyToClipboard(a){copyTextToClipboard(a)}tests="blink/tools/run_layout_tests.py "+allLinks().map(function(a){return a.innerHTML}).join(" ");copyToClipboard(tests);function copyTextToClipboard(a){var b=document.createElement("textarea");b.style.position="fixed";b.style.top=0;b.style.left=0;b.style.width="2em";b.style.height="2em";b.style.padding=0;b.style.border="none";b.style.outline="none";b.style.boxShadow="none";b.style.background="transparent";b.value=a;document.body.appendChild(b);b.select();try{var c=document.execCommand("copy");console.log("Copying text command was "+(c?"successful":"unsuccessful"))}catch(d){console.log("Oops, unable to copy")}document.body.removeChild(b)};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment