Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(77)

Side by Side Diff: chrome/test/webdriver/frame_path_unittest.cc

Issue 23526047: Delete old chromedriver code, and remove mongoose webserver. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/webdriver/frame_path.cc ('k') | chrome/test/webdriver/http_response.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include <string>
6 #include <vector>
7
8 #include "chrome/test/webdriver/frame_path.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 namespace webdriver {
12
13 TEST(FramePathTest, Constructors) {
14 EXPECT_EQ("", FramePath().value());
15 EXPECT_EQ("frame", FramePath("frame").value());
16 EXPECT_EQ("frame", FramePath(FramePath("frame")).value());
17 }
18
19 TEST(FramePathTest, Append) {
20 EXPECT_EQ("frame", FramePath().Append("frame").value());
21 EXPECT_EQ("frame1\nframe2", FramePath("frame1").Append("frame2").value());
22 }
23
24 TEST(FramePathTest, Parent) {
25 FramePath path = FramePath("frame1").Append("frame2");
26 EXPECT_EQ("frame1", path.Parent().value());
27 EXPECT_EQ("", path.Parent().Parent().value());
28 EXPECT_EQ("", path.Parent().Parent().Parent().value());
29 }
30
31 TEST(FramePathTest, BaseName) {
32 FramePath path = FramePath("frame1").Append("frame2");
33 EXPECT_EQ("frame2", path.BaseName().value());
34 EXPECT_EQ("frame1", path.Parent().BaseName().value());
35 EXPECT_EQ("", path.Parent().Parent().BaseName().value());
36 }
37
38 TEST(FramePathTest, GetComponents) {
39 FramePath path = FramePath("frame1").Append("frame2");
40 std::vector<std::string> components;
41 path.GetComponents(&components);
42 ASSERT_EQ(2u, components.size());
43 EXPECT_EQ("frame1", components[0]);
44 EXPECT_EQ("frame2", components[1]);
45
46 components.clear();
47 path.Parent().GetComponents(&components);
48 ASSERT_EQ(1u, components.size());
49 EXPECT_EQ("frame1", components[0]);
50
51 components.clear();
52 path.Parent().Parent().GetComponents(&components);
53 EXPECT_EQ(0u, components.size());
54 }
55
56 TEST(FramePathTest, IsRootFrame) {
57 EXPECT_TRUE(FramePath().IsRootFrame());
58 EXPECT_FALSE(FramePath("frame").IsRootFrame());
59 }
60
61 TEST(FramePathTest, IsSubframe) {
62 EXPECT_FALSE(FramePath().IsSubframe());
63 EXPECT_TRUE(FramePath("frame").IsSubframe());
64 }
65
66 } // namespace webdriver
OLDNEW
« no previous file with comments | « chrome/test/webdriver/frame_path.cc ('k') | chrome/test/webdriver/http_response.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698