blob: a376656b63ebd6495e863b76e5839e50746a52c1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "chrome/test/ui/npapi_test_helper.h"
#include "base/file_util.h"
#include "base/test/test_file_util.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "webkit/plugins/npapi/plugin_list.h"
namespace npapi_test {
const char kTestCompleteCookie[] = "status";
const char kTestCompleteSuccess[] = "OK";
} // namespace npapi_test.
NPAPITesterBase::NPAPITesterBase() {
// Some NPAPI tests schedule garbage collection to force object tear-down.
launch_arguments_.AppendSwitchASCII(switches::kJavaScriptFlags,
"--expose_gc");
}
void NPAPITesterBase::SetUp() {
#if defined(OS_MACOSX)
// The plugins directory isn't read by default on the Mac, so it needs to be
// explicitly registered.
launch_arguments_.AppendSwitchPath(switches::kExtraPluginDir,
GetPluginsDirectory());
#endif
UITest::SetUp();
}
FilePath NPAPITesterBase::GetPluginsDirectory() {
FilePath plugins_directory = browser_directory_.AppendASCII("plugins");
return plugins_directory;
}
// NPAPIVisiblePluginTester members.
void NPAPIVisiblePluginTester::SetUp() {
show_window_ = true;
NPAPITesterBase::SetUp();
}
// NPAPIIncognitoTester members.
void NPAPIIncognitoTester::SetUp() {
launch_arguments_.AppendSwitch(switches::kIncognito);
NPAPITesterBase::SetUp();
}
|