func (chrome *MockChrome) STDERR() string {
	return chrome.stderr
}
/*
STDERR implements Chromium.
package chrome
import (
	"fmt"
	"net/url"
	"os"
	"path/filepath"
	errs "github.com/bdlm/errors"
	"github.com/bdlm/log"
	"github.com/mkenney/go-chrome/codes"
)
func NewMock(
	flags ChromiumFlags,
	binary string,
	workdir string,
	stdout string,
	stderr string,
) *MockChrome {
	return &MockChrome{
		flags:   flags,
		binary:  binary,
		stderr:  stderr,
		stdout:  stdout,
		workdir: workdir,
	}
}
type MockChrome struct {
	flags ChromiumFlags
	binary string
	tabs []*Tab
	version *Version
	workdir string
	stderr string
	stdout string
	stdERRFile *os.File
	stdOUTFile *os.File
	process *os.Process
}
func (chrome *MockChrome) Address() string {
	return "localhost"
}
func (chrome *MockChrome) Flags() ChromiumFlags {
	return chrome.flags
}
func (chrome *MockChrome) Binary() string {
	if "" == chrome.binary {
		chrome.binary = "/usr/bin/google-chrome"
	}
	return chrome.binary
}
func (chrome *MockChrome) Close() error {
	if chrome.stdOUTFile != nil {
		chrome.stdOUTFile.Close()
	}
	return nil
}
func (chrome *MockChrome) DebuggingAddress() string {
	if !chrome.Flags().Has("remote-debugging-address") {
		chrome.Flags().Set("remote-debugging-address", "0.0.0.0")
	}
	value, _ := chrome.Flags().Get("remote-debugging-address")
	return value.(string)
}
func (chrome *MockChrome) DebuggingPort() int {
	if !chrome.Flags().Has("remote-debugging-port") {
		chrome.Flags().Set("remote-debugging-port", 9222)
	}
	value, _ := chrome.Flags().Get("remote-debugging-port")
	return value.(int)
}
func (chrome *MockChrome) GetTab(tabID string) (Tabber, error) {
	var tab Tabber
	var err error
	for _, tab = range chrome.tabs {
		if tab.Data().ID == tabID {
			return tab, nil
		}
	}
	err = errs.New(codes.MockErr, fmt.Sprintf("tab '%s' not found", tabID))
	return tab, err
}
func (chrome *MockChrome) Launch() error {
	var err error
	chrome.Address()
	chrome.DebuggingAddress()
	chrome.DebuggingPort()
	chrome.Port()
	if !chrome.Flags().Has("user-data-dir") {
		chrome.Flags().Set("user-data-dir", os.TempDir())
	}
	if "" == chrome.STDERR() {
		chrome.stdERRFile = os.Stderr
	} else {
		chrome.stdERRFile, err = os.OpenFile(
			chrome.STDERR(),
			os.O_APPEND|os.O_CREATE|os.O_RDWR,
			0600,
		)
		if err != nil {
			return errs.Wrap(err, codes.MockErr, fmt.Sprintf("cannot open error output file '%s'", chrome.STDERR()))
		}
	}
	if "" == chrome.STDOUT() {
		chrome.stdOUTFile = os.Stdout
	} else {
		chrome.stdOUTFile, err = os.OpenFile(
			chrome.STDOUT(),
			os.O_APPEND|os.O_CREATE|os.O_RDWR,
			0600,
		)
		if err != nil {
			return errs.Wrap(err, codes.MockErr, fmt.Sprintf("cannot open standard output file '%s'", chrome.STDOUT()))
		}
	}
	log.Infof("Starting process: %s %s", chrome.Binary(), chrome.Flags())
	if nil != err {
		chrome.stdOUTFile.Close()
		chrome.stdERRFile.Close()
		return errs.Wrap(err, codes.MockErr, "error starting chrome")
	}
	return nil
}
func (chrome *MockChrome) Port() int {
	if !chrome.Flags().Has("port") {
		chrome.Flags().Set("port", 9222)
	}
	value, _ := chrome.Flags().Get("port")
	return value.(int)
}
func (chrome *MockChrome) Query(
	path string,
	params url.Values,
	msg interface{},  
) (interface{}, error) {
	if len(params) > 0 {
		path += fmt.Sprintf("?%s", params.Encode())
	}
	log.Debugf("chrome:/%s", path)
	return msg, nil
}
func (chrome *MockChrome) RemoveTab(tab *Tab) {
	tabs := make([]*Tab, 0)
	for k, t := range chrome.tabs {
		if t == tab {
			chrome.tabs = append(chrome.tabs[:k], chrome.tabs[k+1:]...)
			break
		}
	}
	chrome.tabs = tabs
}